def create_test_tree(metadata_path, manifest): expected_map = {} test_id_path_map = {} exclude_types = frozenset(["stub", "helper", "manual"]) include_types = set(manifest.item_types) ^ exclude_types for test_path, tests in manifest.itertypes(*include_types): expected_data = load_expected(metadata_path, test_path, tests) if expected_data is None: expected_data = create_expected(test_path, tests) expected_map[test_path] = expected_data for test in tests: test_id_path_map[test.id] = test_path return expected_map, test_id_path_map
def iter_tests(self): manifest_items = [] for manifest in self.manifests.keys(): manifest_items.extend(self.test_filter(manifest.itertypes(*self.test_types))) if self.chunker is not None: manifest_items = self.chunker(manifest_items) for test_path, tests in manifest_items: manifest_file = iter(tests).next().manifest metadata_path = self.manifests[manifest_file]["metadata_path"] expected_file = self.load_expected_manifest(manifest_file, metadata_path, test_path) for manifest_test in tests: test = self.get_test(manifest_test, expected_file) test_type = manifest_test.item_type yield test_path, test_type, test