from __future__ import unicode_literals, print_function

import os
import shutil

TEST_SITE_DIRECTORY = 'import_test_site'


def main(import_directory=None):
    if import_directory is None:
        import_directory = TEST_SITE_DIRECTORY

    if os.path.exists(import_directory):
        print('deleting %s' % import_directory)
        shutil.rmtree(import_directory)

    test_directory = os.path.dirname(__file__)
    package_directory = os.path.abspath(os.path.join(test_directory, '..'))

    os.system('echo "y" | pip uninstall Nikola')
    os.system('pip install %s' % package_directory)
    os.system('nikola')
    import_file = os.path.join(test_directory, 'wordpress_export_example.xml')
    os.system(
        'nikola import_wordpress -f %s -o %s' % (import_file, import_directory))

    assert os.path.exists(
        import_directory), "The directory %s should be existing."
    os.chdir(import_directory)
    os.system('nikola build')

if __name__ == '__main__':
    main()

from __future__ import unicode_literals, print_function

import os
import shutil

TEST_SITE_DIRECTORY = 'import_test_site'


def main(import_directory=None):
    if import_directory is None:
        import_directory = TEST_SITE_DIRECTORY

    if os.path.exists(import_directory):
        print('deleting %s' % import_directory)
        shutil.rmtree(import_directory)

    test_directory = os.path.dirname(__file__)
    package_directory = os.path.abspath(os.path.join(test_directory, '..'))

    os.system('echo "y" | pip uninstall Nikola')
    os.system('pip install %s' % package_directory)
    os.system('nikola')
    import_file = os.path.join(test_directory, 'wordpress_export_example.xml')
    os.system(
        'nikola import_wordpress -o {folder} {file}'.format(file=import_file,
                                                            folder=import_directory))

    assert os.path.exists(
        import_directory), "The directory %s should be existing."
    os.chdir(import_directory)
    os.system('nikola build')

if __name__ == '__main__':
    main()

Use the more or less new options for importing
Use the more or less new options for importing

  from __future__ import unicode_literals, print_function
  
  import os
  import shutil
  
  TEST_SITE_DIRECTORY = 'import_test_site'
  
  
  def main(import_directory=None):
      if import_directory is None:
          import_directory = TEST_SITE_DIRECTORY
  
      if os.path.exists(import_directory):
          print('deleting %s' % import_directory)
          shutil.rmtree(import_directory)
  
      test_directory = os.path.dirname(__file__)
      package_directory = os.path.abspath(os.path.join(test_directory, '..'))
  
      os.system('echo "y" | pip uninstall Nikola')
      os.system('pip install %s' % package_directory)
      os.system('nikola')
      import_file = os.path.join(test_directory, 'wordpress_export_example.xml')
      os.system(
-         'nikola import_wordpress -f %s -o %s' % (import_file, import_directory))
+         'nikola import_wordpress -o {folder} {file}'.format(file=import_file,
+                                                             folder=import_directory))
  
      assert os.path.exists(
          import_directory), "The directory %s should be existing."
      os.chdir(import_directory)
      os.system('nikola build')
  
  if __name__ == '__main__':
      main()
  
Use the more or less new options for importing
## Code Before:
from __future__ import unicode_literals, print_function

import os
import shutil

TEST_SITE_DIRECTORY = 'import_test_site'


def main(import_directory=None):
    if import_directory is None:
        import_directory = TEST_SITE_DIRECTORY

    if os.path.exists(import_directory):
        print('deleting %s' % import_directory)
        shutil.rmtree(import_directory)

    test_directory = os.path.dirname(__file__)
    package_directory = os.path.abspath(os.path.join(test_directory, '..'))

    os.system('echo "y" | pip uninstall Nikola')
    os.system('pip install %s' % package_directory)
    os.system('nikola')
    import_file = os.path.join(test_directory, 'wordpress_export_example.xml')
    os.system(
        'nikola import_wordpress -f %s -o %s' % (import_file, import_directory))

    assert os.path.exists(
        import_directory), "The directory %s should be existing."
    os.chdir(import_directory)
    os.system('nikola build')

if __name__ == '__main__':
    main()

## Instruction:
Use the more or less new options for importing
## Code After:
from __future__ import unicode_literals, print_function

import os
import shutil

TEST_SITE_DIRECTORY = 'import_test_site'


def main(import_directory=None):
    if import_directory is None:
        import_directory = TEST_SITE_DIRECTORY

    if os.path.exists(import_directory):
        print('deleting %s' % import_directory)
        shutil.rmtree(import_directory)

    test_directory = os.path.dirname(__file__)
    package_directory = os.path.abspath(os.path.join(test_directory, '..'))

    os.system('echo "y" | pip uninstall Nikola')
    os.system('pip install %s' % package_directory)
    os.system('nikola')
    import_file = os.path.join(test_directory, 'wordpress_export_example.xml')
    os.system(
        'nikola import_wordpress -o {folder} {file}'.format(file=import_file,
                                                            folder=import_directory))

    assert os.path.exists(
        import_directory), "The directory %s should be existing."
    os.chdir(import_directory)
    os.system('nikola build')

if __name__ == '__main__':
    main()
