예제 #1
0
파일: testing.py 프로젝트: jay-z007/dxr
 def setup_class(cls):
     """Build the instance."""
     # nose does some amazing magic that makes this work even if there are
     # multiple test modules with the same name:
     cls._config_dir_path = dirname(sys.modules[cls.__module__].__file__)
     chdir(cls._config_dir_path)
     run('dxr index')
     cls._es().refresh()
예제 #2
0
파일: testing.py 프로젝트: sunglim/dxr
 def setup_class(cls):
     """Build the instance."""
     # nose does some amazing magic that makes this work even if there are
     # multiple test modules with the same name:
     cls._config_dir_path = dirname(sys.modules[cls.__module__].__file__)
     chdir(cls._config_dir_path)
     run('dxr index')
     cls._es().refresh()
예제 #3
0
def clean(config, tree_names):
    """Remove logs, temp files, and build artifacts.

    Remove the filesystem debris left after indexing one or more TREES, leaving
    the index itself intact. Delete log files and, if present, temp files. Run
    `make clean` (or other clean_command from the config file) on trees.

    """
    for tree in tree_objects(tree_names, config):
        rmtree_if_exists(tree.log_folder)
        rmtree_if_exists(tree.temp_folder)
        chdir(tree.object_folder)
        if tree.clean_command:
            try:
                run(tree.clean_command)
            except CommandFailure as exc:
                raise ClickException(
                    'Running clean_command failed for "%s" tree: %s.' %
                    (tree.name, str(exc)))
예제 #4
0
파일: testing.py 프로젝트: jay-z007/dxr
 def teardown_class(cls):
     chdir(cls._config_dir_path)
     cls._delete_es_indices()  # TODO: Replace with a call to 'dxr delete --force'.
     run('dxr clean')
예제 #5
0
 def dxr_index(cls):
     """Run the `dxr index` command in the config file's directory."""
     with cd(cls._config_dir_path):
         run('dxr index')
예제 #6
0
 def teardown_class(cls):
     with cd(cls._config_dir_path):
         run('dxr clean')
     super(DxrInstanceTestCase, cls).teardown_class()
예제 #7
0
파일: testing.py 프로젝트: sunglim/dxr
 def teardown_class(cls):
     chdir(cls._config_dir_path)
     cls._delete_es_indices()  # TODO: Replace with a call to 'dxr delete --force'.
     run('dxr clean')
예제 #8
0
파일: testing.py 프로젝트: dbacarel/dxr
 def dxr_index(cls):
     """Run the `dxr index` command in the config file's directory."""
     with cd(cls._config_dir_path):
         run('dxr index')
예제 #9
0
파일: testing.py 프로젝트: dbacarel/dxr
 def teardown_class(cls):
     with cd(cls._config_dir_path):
         run('dxr clean')
     super(DxrInstanceTestCase, cls).teardown_class()