From f7cfad8e52695b97bf6a25e2a32a005c22341949 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 8 Oct 2019 21:34:10 +0100 Subject: [PATCH 1/3] :shirt: make main's import looks sane --- moban/main.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/moban/main.py b/moban/main.py index 9d59c7e6..de2b742c 100644 --- a/moban/main.py +++ b/moban/main.py @@ -14,13 +14,11 @@ import logging.config from collections import defaultdict -from moban import core, constants, exceptions -from moban.core import mobanfile +from moban import constants, exceptions +from moban.core import ENGINES, plugins, hashstore, mobanfile, data_loader from moban._version import __version__ from moban.externals import reporter, file_system -from moban.core.hashstore import HASH_STORE from moban.program_options import OPTIONS -from moban.core.data_loader import merge, load_data LOG = logging.getLogger() LOG_LEVEL = [logging.WARNING, logging.INFO, logging.DEBUG] @@ -34,7 +32,7 @@ def main(): options = vars(parser.parse_args()) handle_verbose(options[constants.LABEL_VERBOSE]) load_engine_factory_and_engines() # Error: jinja2 if removed - HASH_STORE.IGNORE_CACHE_FILE = options[constants.LABEL_FORCE] + hashstore.HASH_STORE.IGNORE_CACHE_FILE = options[constants.LABEL_FORCE] options[constants.CLI_DICT] = handle_custom_variables( options.pop(constants.LABEL_DEFINE) ) @@ -174,7 +172,7 @@ def handle_moban_file(moban_file, options): """ act upon default moban file """ - moban_file_configurations = load_data(None, moban_file) + moban_file_configurations = data_loader.load_data(None, moban_file) if moban_file_configurations is None: raise exceptions.MobanfileGrammarException( constants.ERROR_INVALID_MOBAN_FILE % moban_file @@ -196,7 +194,7 @@ def handle_moban_file(moban_file, options): raise exceptions.MobanfileGrammarException( constants.MESSAGE_FILE_VERSION_NOT_SUPPORTED % version ) - HASH_STORE.save_hashes() + hashstore.HASH_STORE.save_hashes() def check_none(data, moban_file): @@ -225,8 +223,8 @@ def handle_command_line(options): """ act upon command options """ - options = merge(options, constants.DEFAULT_OPTIONS) - engine = core.ENGINES.get_engine( + options = data_loader.merge(options, constants.DEFAULT_OPTIONS) + engine = ENGINES.get_engine( options[constants.LABEL_TEMPLATE_TYPE], options[constants.LABEL_TMPL_DIRS], options[constants.LABEL_CONFIG_DIR], @@ -251,7 +249,7 @@ def handle_command_line(options): options[constants.LABEL_OUTPUT], ) engine.report() - HASH_STORE.save_hashes() + hashstore.HASH_STORE.save_hashes() exit_code = reporter.convert_to_shell_exit_code( engine.number_of_templated_files() ) @@ -268,7 +266,7 @@ def find_default_moban_file(): def load_engine_factory_and_engines(): - core.plugins.make_sure_all_pkg_are_loaded() + plugins.make_sure_all_pkg_are_loaded() def handle_custom_variables(list_of_definitions): @@ -287,7 +285,7 @@ def handle_custom_extensions(list_of_definitions): for definition in list_of_definitions: key, value = definition.split("=") user_extensions[key].add(value) - core.ENGINES.register_extensions(user_extensions) + ENGINES.register_extensions(user_extensions) def handle_verbose(verbose_level): From 692a4e93d1afa3a2cb5b926f67091cf49d25d662 Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 8 Oct 2019 21:39:33 +0100 Subject: [PATCH 2/3] :tractor: relocate mkdir_p function to external dependencies folder --- moban/core/utils.py | 12 ------------ moban/deprecated/repo.py | 3 +-- moban/externals/buffered_writer.py | 3 +-- moban/externals/file_system.py | 11 +++++++++++ tests/test_file_system.py | 20 ++++++++++++++++++++ tests/test_utils.py | 23 ----------------------- 6 files changed, 33 insertions(+), 39 deletions(-) delete mode 100644 tests/test_utils.py diff --git a/moban/core/utils.py b/moban/core/utils.py index 281070da..884e0e19 100644 --- a/moban/core/utils.py +++ b/moban/core/utils.py @@ -1,5 +1,3 @@ -import os -import errno import logging from moban import constants, exceptions @@ -8,16 +6,6 @@ LOG = logging.getLogger(__name__) -def mkdir_p(path): - try: - os.makedirs(path) - except OSError as exc: # Python >2.5 - if exc.errno == errno.EEXIST and os.path.isdir(path): - pass - else: - raise - - def verify_the_existence_of_directories(dirs): LOG.debug("Verifying the existence: %s", dirs) if not isinstance(dirs, list): diff --git a/moban/deprecated/repo.py b/moban/deprecated/repo.py index 8a854697..b4f2492e 100644 --- a/moban/deprecated/repo.py +++ b/moban/deprecated/repo.py @@ -3,7 +3,6 @@ from moban import constants, exceptions from moban.externals import reporter, file_system -from moban.core.utils import mkdir_p def git_clone(requires): @@ -16,7 +15,7 @@ def git_clone(requires): make_sure_git_is_available() moban_home = get_moban_home() - mkdir_p(moban_home) + file_system.mkdir_p(moban_home) for require in requires: repo_name = get_repo_name(require.git_url) diff --git a/moban/externals/buffered_writer.py b/moban/externals/buffered_writer.py index 10f325e0..268f2816 100644 --- a/moban/externals/buffered_writer.py +++ b/moban/externals/buffered_writer.py @@ -3,7 +3,6 @@ import fs import fs.path -from moban.core import utils from moban.externals import file_system PY2 = sys.version_info[0] == 2 @@ -44,6 +43,6 @@ def write_file_out(filename, content): if not file_system.is_zip_alike_url(filename): dest_folder = os.path.dirname(filename) if dest_folder: - utils.mkdir_p(dest_folder) + file_system.mkdir_p(dest_folder) file_system.write_bytes(filename, content) diff --git a/moban/externals/file_system.py b/moban/externals/file_system.py index f08554f4..b6fb05e0 100644 --- a/moban/externals/file_system.py +++ b/moban/externals/file_system.py @@ -1,6 +1,7 @@ import os import sys import stat +import errno import logging from contextlib import contextmanager @@ -260,3 +261,13 @@ def get_multi_fs(directories): for directory in directories: filesystem.add_fs(directory, fs.open_fs(directory)) return filesystem + + +def mkdir_p(path): + try: + os.makedirs(path) + except OSError as exc: # Python >2.5 + if exc.errno == errno.EEXIST and os.path.isdir(path): + pass + else: + raise diff --git a/tests/test_file_system.py b/tests/test_file_system.py index c13a000c..02b36cbe 100644 --- a/tests/test_file_system.py +++ b/tests/test_file_system.py @@ -1,7 +1,9 @@ import os import sys import stat +from shutil import rmtree +from mock import patch from nose import SkipTest from nose.tools import eq_, raises from moban.externals import file_system @@ -243,3 +245,21 @@ def test_file_permission_copy_symlink(): os.unlink(test_source) os.unlink(test_dest) os.unlink(test_symlink) + + +def test_mkdir_p(): + test_path = "a/b/c/d" + file_system.mkdir_p(test_path) + assert os.path.exists(test_path) + rmtree(test_path) + + +@patch("subprocess.check_call") +def test_pip_install(fake_check_all): + import sys + from moban.deprecated import pip_install + + pip_install(["package1", "package2"]) + fake_check_all.assert_called_with( + [sys.executable, "-m", "pip", "install", "package1 package2"] + ) diff --git a/tests/test_utils.py b/tests/test_utils.py deleted file mode 100644 index 2c0ef8e8..00000000 --- a/tests/test_utils.py +++ /dev/null @@ -1,23 +0,0 @@ -import os -from shutil import rmtree - -from mock import patch -from moban.core.utils import mkdir_p - - -def test_mkdir_p(): - test_path = "a/b/c/d" - mkdir_p(test_path) - assert os.path.exists(test_path) - rmtree(test_path) - - -@patch("subprocess.check_call") -def test_pip_install(fake_check_all): - import sys - from moban.deprecated import pip_install - - pip_install(["package1", "package2"]) - fake_check_all.assert_called_with( - [sys.executable, "-m", "pip", "install", "package1 package2"] - ) From 764757c2a64bc289f303d8c6bfbed0265969c08c Mon Sep 17 00:00:00 2001 From: chfw Date: Tue, 8 Oct 2019 22:03:29 +0100 Subject: [PATCH 3/3] :shirt: adjust import spacing in files --- .isort.cfg | 4 ++-- .../custom-data-loader/custom.py | 3 ++- moban/core/data_loader.py | 3 ++- moban/core/moban_factory.py | 3 ++- moban/core/mobanfile/__init__.py | 3 ++- moban/core/plugins.py | 3 ++- moban/deprecated/library.py | 3 ++- moban/externals/buffered_writer.py | 1 + moban/externals/file_system.py | 3 ++- moban/externals/reporter.py | 1 + moban/plugins/copy.py | 3 ++- moban/plugins/jinja2/engine.py | 6 +++--- moban/plugins/jinja2/extensions.py | 3 ++- moban/plugins/json_loader.py | 3 ++- moban/plugins/yaml_loader.py | 3 ++- tests/core/test_context.py | 1 + tests/core/test_engine.py | 3 ++- tests/core/test_moban_factory.py | 5 +++-- tests/data_loaders/test_json_loader.py | 1 + tests/data_loaders/test_overrides.py | 1 + tests/data_loaders/test_yaml_loader.py | 1 + tests/deprecated/test_handle_requires.py | 1 + tests/deprecated/test_repo.py | 1 + tests/integration_tests/test_command_line_options.py | 1 + tests/jinja2/test_engine.py | 3 ++- tests/jinja2/test_extensions.py | 3 ++- tests/jinja2/test_github.py | 1 + tests/jinja2/test_repr.py | 1 + tests/jinja2/test_text.py | 1 + tests/mobanfile/test_mobanfile.py | 1 + tests/mobanfile/test_targets.py | 1 + tests/mobanfile/test_templates.py | 1 + tests/test_buffered_writer.py | 1 + tests/test_copy_engine.py | 1 + tests/test_definitions.py | 1 + tests/test_file_system.py | 1 + tests/test_hash_store.py | 1 + tests/test_main.py | 3 ++- tests/test_regression.py | 2 +- tests/test_reporter.py | 1 + tests/utils.py | 3 ++- 41 files changed, 62 insertions(+), 24 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index 25965d9b..33965f07 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -2,11 +2,11 @@ line_length=79 # Ignore generated files skip=setup.py, moban/__init__.py -known_first_party=fs, lml, crayons, jinja2, ruamel.yaml, mock, nose +known_third_party=fs, lml, crayons, jinja2, ruamel.yaml, mock, nose indent=' ' multi_line_output=3 length_sort=1 include_trailing_comma=true default_section=FIRSTPARTY no_lines_before=LOCALFOLDER -sections=FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,LOCALFOLDER +sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER diff --git a/docs/level-14-custom-data-loader/custom-data-loader/custom.py b/docs/level-14-custom-data-loader/custom-data-loader/custom.py index f7c32dad..61813cce 100644 --- a/docs/level-14-custom-data-loader/custom-data-loader/custom.py +++ b/docs/level-14-custom-data-loader/custom-data-loader/custom.py @@ -1,8 +1,9 @@ import csv -from moban import constants from lml.plugin import PluginInfo +from moban import constants + @PluginInfo(constants.DATA_LOADER_EXTENSION, tags=["custom"]) def open_custom(file_name): diff --git a/moban/core/data_loader.py b/moban/core/data_loader.py index 35cf8bdd..f9ab2434 100644 --- a/moban/core/data_loader.py +++ b/moban/core/data_loader.py @@ -1,7 +1,8 @@ from collections import OrderedDict -from moban import constants from lml.plugin import PluginManager + +from moban import constants from moban.externals import file_system diff --git a/moban/core/moban_factory.py b/moban/core/moban_factory.py index 128483a4..101394ce 100644 --- a/moban/core/moban_factory.py +++ b/moban/core/moban_factory.py @@ -3,9 +3,10 @@ import logging from collections import defaultdict -from moban import constants, exceptions from fs.errors import ResourceNotFound from lml.plugin import PluginManager + +from moban import constants, exceptions from moban.core import utils from moban.externals import reporter, file_system from moban.deprecated import deprecated_moban_path_notation diff --git a/moban/core/mobanfile/__init__.py b/moban/core/mobanfile/__init__.py index 3dd51c2d..ffb2e641 100644 --- a/moban/core/mobanfile/__init__.py +++ b/moban/core/mobanfile/__init__.py @@ -4,8 +4,9 @@ import logging from collections import OrderedDict -from moban import core, constants from lml.utils import do_import + +from moban import core, constants from moban.externals import reporter from moban.core.utils import verify_the_existence_of_directories from moban.deprecated import handle_copy, handle_requires diff --git a/moban/core/plugins.py b/moban/core/plugins.py index 70e7281c..486c64cc 100644 --- a/moban/core/plugins.py +++ b/moban/core/plugins.py @@ -1,6 +1,7 @@ -from moban import constants from lml.loader import scan_plugins_regex +from moban import constants + BUILTIN_EXENSIONS = [ "moban.plugins.jinja2.engine", "moban.plugins.yaml_loader", diff --git a/moban/deprecated/library.py b/moban/deprecated/library.py index 4c7405dc..ff9c782d 100644 --- a/moban/deprecated/library.py +++ b/moban/deprecated/library.py @@ -1,6 +1,7 @@ -from moban import constants from lml.plugin import PluginManager +from moban import constants + class LibraryManager(PluginManager): def __init__(self): diff --git a/moban/externals/buffered_writer.py b/moban/externals/buffered_writer.py index 268f2816..dd8b5242 100644 --- a/moban/externals/buffered_writer.py +++ b/moban/externals/buffered_writer.py @@ -3,6 +3,7 @@ import fs import fs.path + from moban.externals import file_system PY2 = sys.version_info[0] == 2 diff --git a/moban/externals/file_system.py b/moban/externals/file_system.py index b6fb05e0..3aaf4497 100644 --- a/moban/externals/file_system.py +++ b/moban/externals/file_system.py @@ -7,9 +7,10 @@ import fs import fs.path -from moban import exceptions from fs.multifs import MultiFS +from moban import exceptions + try: from urllib.parse import urlparse except ImportError: diff --git a/moban/externals/reporter.py b/moban/externals/reporter.py index e79ad989..e7fb2eec 100644 --- a/moban/externals/reporter.py +++ b/moban/externals/reporter.py @@ -1,4 +1,5 @@ import crayons + import moban.constants as constants MESSAGE_TEMPLATING = "Templating {0} to {1}" diff --git a/moban/plugins/copy.py b/moban/plugins/copy.py index fe9d22c4..455c9227 100644 --- a/moban/plugins/copy.py +++ b/moban/plugins/copy.py @@ -1,5 +1,6 @@ -from moban import constants from lml.plugin import PluginInfo + +from moban import constants from moban.externals import file_system diff --git a/moban/plugins/jinja2/engine.py b/moban/plugins/jinja2/engine.py index df44a23b..88080157 100644 --- a/moban/plugins/jinja2/engine.py +++ b/moban/plugins/jinja2/engine.py @@ -3,14 +3,14 @@ from importlib import import_module import fs.errors -from moban import constants from jinja2 import Template, Environment from lml.loader import scan_plugins_regex from lml.plugin import PluginInfo, PluginManager -from moban.externals import file_system +from jinja2_fsloader import FSLoader from jinja2.exceptions import TemplateNotFound -from jinja2_fsloader import FSLoader +from moban import constants +from moban.externals import file_system JINJA2_LIBRARIES = "^moban_jinja2_.+$" JINJA2_EXTENSIONS = [ diff --git a/moban/plugins/jinja2/extensions.py b/moban/plugins/jinja2/extensions.py index a4817ca1..7b21dbfd 100644 --- a/moban/plugins/jinja2/extensions.py +++ b/moban/plugins/jinja2/extensions.py @@ -1,6 +1,7 @@ -from moban import constants from lml.plugin import PluginInfo +from moban import constants + class JinjaFilter(PluginInfo): def __init__(self): diff --git a/moban/plugins/json_loader.py b/moban/plugins/json_loader.py index 2069ad78..8e56a5bf 100644 --- a/moban/plugins/json_loader.py +++ b/moban/plugins/json_loader.py @@ -1,7 +1,8 @@ import json -from moban import constants from lml.plugin import PluginInfo + +from moban import constants from moban.externals.file_system import open_file diff --git a/moban/plugins/yaml_loader.py b/moban/plugins/yaml_loader.py index bfa41185..10780735 100644 --- a/moban/plugins/yaml_loader.py +++ b/moban/plugins/yaml_loader.py @@ -1,6 +1,7 @@ -from moban import constants from lml.plugin import PluginInfo from ruamel.yaml import YAML + +from moban import constants from moban.externals.file_system import open_file diff --git a/tests/core/test_context.py b/tests/core/test_context.py index 846d2383..d9e39bc7 100644 --- a/tests/core/test_context.py +++ b/tests/core/test_context.py @@ -2,6 +2,7 @@ import fs.path from nose.tools import eq_ + from moban.core.context import Context diff --git a/tests/core/test_engine.py b/tests/core/test_engine.py index d1c6c790..b64a2f0a 100644 --- a/tests/core/test_engine.py +++ b/tests/core/test_engine.py @@ -2,8 +2,9 @@ import fs.path from mock import patch -from moban.core import ENGINES from nose.tools import eq_ + +from moban.core import ENGINES from moban.definitions import TemplateTarget from moban.jinja2.engine import Engine from moban.data_loaders.yaml import open_yaml diff --git a/tests/core/test_moban_factory.py b/tests/core/test_moban_factory.py index c5f4b179..536d4eea 100644 --- a/tests/core/test_moban_factory.py +++ b/tests/core/test_moban_factory.py @@ -2,11 +2,12 @@ import sys import fs.path -import moban.exceptions as exceptions from mock import patch from lml.plugin import PluginInfo -from moban.core import ENGINES from nose.tools import eq_, raises + +import moban.exceptions as exceptions +from moban.core import ENGINES from moban.core.context import Context from moban.jinja2.engine import ( Engine, diff --git a/tests/data_loaders/test_json_loader.py b/tests/data_loaders/test_json_loader.py index 44ed74fa..c575fcc7 100644 --- a/tests/data_loaders/test_json_loader.py +++ b/tests/data_loaders/test_json_loader.py @@ -1,5 +1,6 @@ import fs.path from nose.tools import eq_ + from moban.data_loaders.json_loader import open_json diff --git a/tests/data_loaders/test_overrides.py b/tests/data_loaders/test_overrides.py index d9b190d3..7bc29bef 100644 --- a/tests/data_loaders/test_overrides.py +++ b/tests/data_loaders/test_overrides.py @@ -1,6 +1,7 @@ import os from nose.tools import eq_ + from moban.data_loaders.manager import load_data diff --git a/tests/data_loaders/test_yaml_loader.py b/tests/data_loaders/test_yaml_loader.py index c8f2c8b1..034926f1 100644 --- a/tests/data_loaders/test_yaml_loader.py +++ b/tests/data_loaders/test_yaml_loader.py @@ -1,5 +1,6 @@ import fs.path from nose.tools import eq_, raises + from moban.data_loaders.yaml import open_yaml from moban.data_loaders.manager import load_data diff --git a/tests/deprecated/test_handle_requires.py b/tests/deprecated/test_handle_requires.py index fa427c8f..f2c66bd5 100644 --- a/tests/deprecated/test_handle_requires.py +++ b/tests/deprecated/test_handle_requires.py @@ -1,5 +1,6 @@ from mock import patch from nose.tools import eq_ + from moban.deprecated import GitRequire diff --git a/tests/deprecated/test_repo.py b/tests/deprecated/test_repo.py index 1cfc571b..eacafbed 100644 --- a/tests/deprecated/test_repo.py +++ b/tests/deprecated/test_repo.py @@ -1,6 +1,7 @@ import fs.path from mock import patch from nose.tools import eq_, raises + from moban.deprecated import GitRequire from moban.exceptions import NoGitCommand from moban.deprecated.repo import ( diff --git a/tests/integration_tests/test_command_line_options.py b/tests/integration_tests/test_command_line_options.py index d3334ae2..7ba46eb6 100644 --- a/tests/integration_tests/test_command_line_options.py +++ b/tests/integration_tests/test_command_line_options.py @@ -5,6 +5,7 @@ from mock import MagicMock, patch from nose import SkipTest from nose.tools import eq_, raises, assert_raises + from moban.core.definitions import TemplateTarget try: diff --git a/tests/jinja2/test_engine.py b/tests/jinja2/test_engine.py index 5238621a..4ebb396f 100644 --- a/tests/jinja2/test_engine.py +++ b/tests/jinja2/test_engine.py @@ -1,7 +1,8 @@ import os -from moban import file_system from nose.tools import eq_ + +from moban import file_system from moban.jinja2.engine import Engine diff --git a/tests/jinja2/test_extensions.py b/tests/jinja2/test_extensions.py index 61ddbf1a..4d602fc9 100644 --- a/tests/jinja2/test_extensions.py +++ b/tests/jinja2/test_extensions.py @@ -1,7 +1,8 @@ import os -from moban import file_system from nose.tools import eq_ + +from moban import file_system from moban.jinja2.engine import Engine from moban.jinja2.extensions import jinja_global from moban.core.moban_factory import MobanEngine diff --git a/tests/jinja2/test_github.py b/tests/jinja2/test_github.py index 2bb043fd..25aa58d1 100644 --- a/tests/jinja2/test_github.py +++ b/tests/jinja2/test_github.py @@ -1,4 +1,5 @@ from nose.tools import eq_ + from moban.jinja2.filters.github import github_expand diff --git a/tests/jinja2/test_repr.py b/tests/jinja2/test_repr.py index c18d458b..01d388ea 100644 --- a/tests/jinja2/test_repr.py +++ b/tests/jinja2/test_repr.py @@ -1,4 +1,5 @@ from nose.tools import eq_ + from moban.jinja2.filters.repr import repr as repr_function diff --git a/tests/jinja2/test_text.py b/tests/jinja2/test_text.py index 177c0c5c..17f000df 100644 --- a/tests/jinja2/test_text.py +++ b/tests/jinja2/test_text.py @@ -1,4 +1,5 @@ from nose.tools import eq_ + from moban.jinja2.filters.text import split_length diff --git a/tests/mobanfile/test_mobanfile.py b/tests/mobanfile/test_mobanfile.py index 0d010a2f..5375ad39 100644 --- a/tests/mobanfile/test_mobanfile.py +++ b/tests/mobanfile/test_mobanfile.py @@ -1,6 +1,7 @@ import fs.path from mock import patch from nose.tools import eq_ + from moban.core.definitions import TemplateTarget diff --git a/tests/mobanfile/test_targets.py b/tests/mobanfile/test_targets.py index 8ede2452..836b481b 100644 --- a/tests/mobanfile/test_targets.py +++ b/tests/mobanfile/test_targets.py @@ -2,6 +2,7 @@ import fs.path from nose.tools import eq_, raises + from moban.exceptions import GroupTargetNotFound from moban.core.mobanfile import targets from moban.core.definitions import TemplateTarget diff --git a/tests/mobanfile/test_templates.py b/tests/mobanfile/test_templates.py index 469aca91..c3b54613 100644 --- a/tests/mobanfile/test_templates.py +++ b/tests/mobanfile/test_templates.py @@ -1,6 +1,7 @@ import fs.path from mock import patch from nose.tools import eq_ + from moban.core.mobanfile.templates import handle_template diff --git a/tests/test_buffered_writer.py b/tests/test_buffered_writer.py index 3a6433c3..02e5caaa 100644 --- a/tests/test_buffered_writer.py +++ b/tests/test_buffered_writer.py @@ -2,6 +2,7 @@ import tempfile from nose.tools import eq_ + from moban.externals import file_system from moban.externals.buffered_writer import BufferedWriter, write_file_out diff --git a/tests/test_copy_engine.py b/tests/test_copy_engine.py index 2acf40e8..f590d21a 100644 --- a/tests/test_copy_engine.py +++ b/tests/test_copy_engine.py @@ -2,6 +2,7 @@ import fs.path from nose.tools import eq_ + from moban.externals import file_system from moban.plugins.copy import ContentForwardEngine diff --git a/tests/test_definitions.py b/tests/test_definitions.py index b70639cd..a9a6a9d5 100644 --- a/tests/test_definitions.py +++ b/tests/test_definitions.py @@ -1,4 +1,5 @@ from nose.tools import eq_ + from moban.deprecated import GitRequire from moban.core.definitions import TemplateTarget diff --git a/tests/test_file_system.py b/tests/test_file_system.py index 02b36cbe..a9fbe33f 100644 --- a/tests/test_file_system.py +++ b/tests/test_file_system.py @@ -6,6 +6,7 @@ from mock import patch from nose import SkipTest from nose.tools import eq_, raises + from moban.externals import file_system from moban.exceptions import FileNotFound diff --git a/tests/test_hash_store.py b/tests/test_hash_store.py index 173b244b..3220fee5 100644 --- a/tests/test_hash_store.py +++ b/tests/test_hash_store.py @@ -2,6 +2,7 @@ import sys from nose import SkipTest + from moban.externals import file_system from moban.core.hashstore import HashStore diff --git a/tests/test_main.py b/tests/test_main.py index bf4976ea..abf381bd 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -2,10 +2,11 @@ import sys from shutil import copyfile -import moban.exceptions as exceptions from mock import MagicMock, patch from nose.tools import eq_, raises, assert_raises +import moban.exceptions as exceptions + class TestException: def setUp(self): diff --git a/tests/test_regression.py b/tests/test_regression.py index 85ab9a48..a91acabd 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -4,8 +4,8 @@ import fs.path from mock import patch -from moban.main import main +from moban.main import main from .utils import Docs diff --git a/tests/test_reporter.py b/tests/test_reporter.py index 785419e6..6450e9b1 100644 --- a/tests/test_reporter.py +++ b/tests/test_reporter.py @@ -2,6 +2,7 @@ from mock import patch from nose.tools import eq_ + from moban.externals import reporter PY2 = sys.version_info[0] == 2 diff --git a/tests/utils.py b/tests/utils.py index c02c94c1..9f9983c4 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -3,9 +3,10 @@ from textwrap import dedent from mock import patch -from moban.main import main from nose.tools import eq_ from fs.opener.parse import parse_fs_url + +from moban.main import main from moban.externals import file_system