Beispiel #1
0
 def f(w):
     collector = Collector(w.spec_root_path)
     imported_files = []
     def mock_import_file_func(path, root):
         imported_files.append(path)
     collector.import_spec_file = mock_import_file_func
     collector.import_spec_files()
     expected = ['a_spec.py', 'b/b_spec.py', 'c/d/d_spec.py']
     expected = set(['%s/%s' % (w.spec_root_path, x) for x in expected])
     assert set(imported_files) == expected, '%r != %r' % (imported_files, expected)
Beispiel #2
0
 def f(w):
     collector = Collector(w.spec_root_path)
     example_suite = ExampleSuite()
     collector.collect_to(example_suite)
     assert len(example_suite.example_groups) == 4
Beispiel #3
0
 def f(w):
     collector = Collector('/path/to/spec')
     root_module = 'rgf_anon_collector'
     mod = collector.import_spec_file(w.spec_file_path, root_module)
     assert re.compile(r'^%s\.spec_[0-9a-f]+$' % root_module).match(mod.__name__)
     assert os.path.splitext(mod.__file__)[0] == os.path.splitext(w.spec_file_path)[0]