def test_import_from_paths(self): cases_path = self.cases_path cases2_path = os.path.join(cases_path, 'loader', 'valid') expected_modules = {'oeid', 'another'} self.cases_path = [self.cases_path, cases2_path] tc = self._testLoader(modules=expected_modules) modules = getSuiteModules(tc.suites) self.cases_path = cases_path msg = 'Expected modules from two different paths' self.assertEqual(modules, expected_modules, msg=msg)
def test_import_from_paths(self): cases_path = self.cases_path cases2_path = os.path.join(cases_path, 'loader', 'valid') expected_modules = {'oeid', 'another'} self.cases_path = [self.cases_path, cases2_path] tc = self._testLoader(modules=expected_modules) modules = getSuiteModules(tc.suites) self.cases_path = cases_path msg = 'Expected modules from two different paths' self.assertEqual(modules, expected_modules, msg=msg)
def _find_duplicated_modules(suite, directory): for module in getSuiteModules(suite): path = findFile('%s.py' % module, directory) if path: raise ImportError("Duplicated %s module found in %s" % (module, path))
def _find_duplicated_modules(suite, directory): for module in getSuiteModules(suite): path = findFile('%s.py' % module, directory) if path: raise ImportError("Duplicated %s module found in %s" % (module, path))
def test_filter_modules(self): expected_modules = {'oeid', 'oetag'} tc = self._testLoader(modules=expected_modules) modules = getSuiteModules(tc.suites) msg = 'Expected just %s modules' % ', '.join(expected_modules) self.assertEqual(modules, expected_modules, msg=msg)
def test_filter_modules(self): expected_modules = {'oeid', 'oetag'} tc = self._testLoader(modules=expected_modules) modules = getSuiteModules(tc.suites) msg = 'Expected just %s modules' % ', '.join(expected_modules) self.assertEqual(modules, expected_modules, msg=msg)