def setUp(self): self.environment_registry = environment_registry.new(convention.DEFAULT, inputs.create_indexed_docs()) self.manager = testplan.Manager( self.environment_registry, testplan.suites_from( inputs.create_indexed_docs( *full_paths('testdata/caserunner_test_exception.yaml')))) self.results = Visitor()
def setUp(self): self.environment_registry = environment_registry.new( 'tag:alpine', inputs.create_indexed_docs( *full_paths('testdata/caserunner_test_target.manifest.yaml'))) self.manager = testplan.Manager( self.environment_registry, testplan.suites_from( inputs.create_indexed_docs( *full_paths('testdata/caserunner_test_target.yaml')))) self.results = Visitor()
def setUp(self): self.environment_registry = environment_registry.new( convention.DEFAULT, inputs.create_indexed_docs( *full_paths('testdata/caserunner_test.manifest.yaml'))) self.manager = testplan.Manager( self.environment_registry, testplan.suites_from( inputs.create_indexed_docs( *full_paths('testdata/caserunner_test.yaml')))) self.results = Visitor() self.manager.accept(testplan.MultiVisitor(runner.Visitor(), summary.SummaryVisitor(verbosity=summary.Detail.FULL, show_errors=True))) if self.manager.accept(self.results) is not None: self.fail('error running test plan: {}'.format(self.results.error))
def setUp(self): self.environment_registry = environment_registry.new( convention.DEFAULT, inputs.create_indexed_docs()) self.manager = testplan.Manager( self.environment_registry, testplan.suites_from( inputs.create_indexed_docs( *full_paths('testdata/caserunner_test_setup_failures.yaml')))) self.results = Visitor() self.manager.accept(testplan.MultiVisitor(runner.Visitor(fail_fast=False), summary.SummaryVisitor(verbosity=summary.Detail.FULL, show_errors=True))) if self.manager.accept(self.results) is not None: self.fail('error running test plan: {}'.format(self.results.error)) self.fname_re = re.compile('^filename: (.+)$', re.MULTILINE)
def setUp(self): filename = full_path('testdata/tag_test.manifest.yaml') manifest = sample_manifest.Manifest('situation') manifest.from_docs(inputs.create_indexed_docs(filename)) manifest.index() self.env = tag.ManifestEnvironment( filename, '', manifest, [], manifest_options = {'chdir': 'switch-dir-to'})
def test_read_files_with_implicit_tags(self): manifest_dir = os.path.abspath(os.path.join(_ABS_DIR, 'testdata', 'sample_manifest')) manifest_h_he_path = os.path.join(manifest_dir, 'h_he', '12.manifest.yaml') manifest_li_be_path = os.path.join(manifest_dir, 'li_be', '34.manifest.yaml') manifest_h_he_dir = os.path.dirname(manifest_h_he_path) manifest_li_be_dir = os.path.dirname(manifest_li_be_path) manifest = sample_manifest.Manifest('model', 'sample') manifest.from_docs(inputs.create_indexed_docs(manifest_h_he_path, manifest_li_be_path)) manifest.index() expect_hydrogen = { 'model': 'periodic', 'sample': 'hydrogen', sample_manifest.IMPLICIT_TAG_SOURCE: manifest_h_he_path, sample_manifest.IMPLICIT_TAG_DIR: manifest_h_he_dir, } expect_helium = { 'model': 'periodic', 'sample': 'helium', sample_manifest.IMPLICIT_TAG_SOURCE: manifest_h_he_path, sample_manifest.IMPLICIT_TAG_DIR: manifest_h_he_dir, } expect_lithium = { 'model': 'periodic', 'sample': 'lithium', sample_manifest.IMPLICIT_TAG_SOURCE: manifest_li_be_path, sample_manifest.IMPLICIT_TAG_DIR: manifest_li_be_dir, } expect_beryllium = { 'model': 'periodic', 'sample': 'beryllium', sample_manifest.IMPLICIT_TAG_SOURCE: manifest_li_be_path, sample_manifest.IMPLICIT_TAG_DIR: manifest_li_be_dir, } self.assertEqual([expect_hydrogen], manifest.get('periodic', 'hydrogen')) self.assertEqual([expect_helium], manifest.get('periodic', 'helium')) self.assertEqual([expect_lithium], manifest.get('periodic', 'lithium')) self.assertEqual([expect_beryllium], manifest.get('periodic', 'beryllium'))
def setUp(self): self.manifest_file_name = full_path('testdata/tag_test.manifest.yaml') manifest = sample_manifest.Manifest('situation') manifest.from_docs(inputs.create_indexed_docs(self.manifest_file_name)) manifest.index() self.env = tag.ManifestEnvironment(self.manifest_file_name, '', manifest, [])