Changeset View
Changeset View
Standalone View
Standalone View
swh/indexer/tests/test_fossology_license.py
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | def setUp(self): | ||||
self.id1 = "688a5ef812c53907562fe379d4b3851e69c7cb15" | self.id1 = "688a5ef812c53907562fe379d4b3851e69c7cb15" | ||||
self.id2 = "da39a3ee5e6b4b0d3255bfef95601890afd80709" # empty content | self.id2 = "da39a3ee5e6b4b0d3255bfef95601890afd80709" # empty content | ||||
tool = {k.replace("tool_", ""): v for (k, v) in self.indexer.tool.items()} | tool = {k.replace("tool_", ""): v for (k, v) in self.indexer.tool.items()} | ||||
# then | # then | ||||
self.expected_results = { | self.expected_results = { | ||||
self.id0: {"tool": tool, "licenses": SHA1_TO_LICENSES[self.id0],}, | self.id0: {"tool": tool, "licenses": SHA1_TO_LICENSES[self.id0],}, | ||||
self.id1: {"tool": tool, "licenses": SHA1_TO_LICENSES[self.id1],}, | self.id1: {"tool": tool, "licenses": SHA1_TO_LICENSES[self.id1],}, | ||||
self.id2: {"tool": tool, "licenses": SHA1_TO_LICENSES[self.id2],}, | self.id2: None, | ||||
} | } | ||||
def tearDown(self): | def tearDown(self): | ||||
super().tearDown() | super().tearDown() | ||||
fossology_license.compute_license = self.orig_compute_license | fossology_license.compute_license = self.orig_compute_license | ||||
class TestFossologyLicensePartitionIndexer( | class TestFossologyLicensePartitionIndexer( | ||||
Show All 36 Lines |