Пример #1
0
 def setup(self):
     m = multiscanner.load_module('test_1', [multiscanner.MODULEDIR])
     global_module_interface = multiscanner._GlobalModuleInterface()
     self.result = multiscanner._run_module('test_1', m, self.filelist,
                                            self.threadDict,
                                            global_module_interface)
     global_module_interface._cleanup()
Пример #2
0
 def setup(self):
     self.m = multiscanner.load_module('test_2', [multiscanner.MODULEDIR])
     self.threadDict['test_2'] = mock.Mock()
     self.threadDict['test_1'] = mock.Mock()
     self.threadDict['test_1'].ret = ([('a', 'a'), ('C:\\c', 'c')], {})
     self.global_module_interface = multiscanner._GlobalModuleInterface()
Пример #3
0
def test_fail_loadModule():
    """Ensure _loadModule works"""
    m = multiscanner.load_module('notathing', [os.path.join(CWD, "modules")])
    assert m is None
Пример #4
0
def test_loadModule():
    """Ensure _loadModule works"""
    m = multiscanner.load_module('test_1', [os.path.join(CWD, "modules")])
    assert isinstance(m, types.ModuleType)
Пример #5
0
 def setup(self):
     self.m = multiscanner.load_module('test_2', [multiscanner.MODULEDIR])
     self.threadDict['test_2'] = mock.Mock()
     self.threadDict['test_1'] = mock.Mock()
     self.threadDict['test_1'].ret = ([('a','a'), ('C:\\c','c')], {})
     self.global_module_interface = multiscanner._GlobalModuleInterface()
Пример #6
0
 def setup(self):
     m = multiscanner.load_module('test_1', [multiscanner.MODULEDIR])
     global_module_interface = multiscanner._GlobalModuleInterface()
     self.result = multiscanner._runModule('test_1', m, self.filelist, self.threadDict, global_module_interface)
     global_module_interface._cleanup()
Пример #7
0
def test_fail_loadModule():
    """Ensure _loadModule works"""
    m = multiscanner.load_module('notathing', [os.path.join(CWD, "modules")])
    assert m is None
Пример #8
0
def test_loadModule():
    """Ensure _loadModule works"""
    m = multiscanner.load_module('test_1', [os.path.join(CWD, "modules")])
    assert isinstance(m, types.ModuleType)