def TestDirClassifier(directory, options): if not os.path.exists(directory): return None return models.TestDir({ 'testdir': directory, 'name': os.path.basename(directory) })
def test_run_suite(self): logging.basicConfig(level=logging.CRITICAL) parser = config.Parser() parser.bootstrap = False options = O() options.dryrun = True options.environment = 'local' options.failfast = True options.tests_yaml=None model = models.TestDir({'name': 'testdir', 'directory': TEST_FILES, 'testdir': TEST_FILES}) suite = spec.Suite(model, options=options) suite.spec(locate('test02')) self.assertEqual(suite[0].name, 'test02') run = runner.Runner(suite, options) results = list(run()) self.assertEqual(len(results), 1) self.assertEqual(results[0]['returncode'], 0)