diff --git a/swh/indexer/tests/test_fossology_license.py b/swh/indexer/tests/test_fossology_license.py --- a/swh/indexer/tests/test_fossology_license.py +++ b/swh/indexer/tests/test_fossology_license.py @@ -66,21 +66,22 @@ self.id0 = '01c9379dfc33803963d07c1ccc748d3fe4c96bb5' self.id1 = '688a5ef812c53907562fe379d4b3851e69c7cb15' self.id2 = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' # empty content + tool_id = self.indexer.tool['id'] # then self.expected_results = { self.id0: { 'id': self.id0, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'licenses': SHA1_TO_LICENSES[self.id0], }, self.id1: { 'id': self.id1, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'licenses': SHA1_TO_LICENSES[self.id1], }, self.id2: { 'id': self.id2, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'licenses': SHA1_TO_LICENSES[self.id2], } } @@ -134,20 +135,21 @@ self.id0 = '01c9379dfc33803963d07c1ccc748d3fe4c96bb5' self.id1 = '02fb2c89e14f7fab46701478c83779c7beb7b069' self.id2 = '103bc087db1d26afc3a0283f38663d081e9b01e6' + tool_id = self.indexer.tool['id'] self.expected_results = { self.id0: { 'id': self.id0, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'licenses': SHA1_TO_LICENSES[self.id0] }, self.id1: { 'id': self.id1, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'licenses': SHA1_TO_LICENSES[self.id1] }, self.id2: { 'id': self.id2, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'licenses': SHA1_TO_LICENSES[self.id2] } } diff --git a/swh/indexer/tests/test_language.py b/swh/indexer/tests/test_language.py --- a/swh/indexer/tests/test_language.py +++ b/swh/indexer/tests/test_language.py @@ -19,7 +19,6 @@ """ def prepare(self): self.config = { - 'destination_task': None, 'tools': { 'name': 'pygments', 'version': '2.0.1+dfsg-1.1+deb8u1', @@ -33,7 +32,6 @@ self.idx_storage = BasicMockIndexerStorage() self.log = logging.getLogger('swh.indexer') self.objstorage = MockObjStorage() - self.destination_task = None self.tool_config = self.config['tools']['configuration'] self.max_content_size = self.tool_config['max_content_size'] self.tools = self.register_tools(self.config['tools']) @@ -69,21 +67,22 @@ self.id0 = '02fb2c89e14f7fab46701478c83779c7beb7b069' self.id1 = '103bc087db1d26afc3a0283f38663d081e9b01e6' self.id2 = 'd4c647f0fc257591cc9ba1722484229780d1c607' + tool_id = self.indexer.tool['id'] self.expected_results = { self.id0: { 'id': self.id0, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'lang': 'python', }, self.id1: { 'id': self.id1, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'lang': 'c' }, self.id2: { 'id': self.id2, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'lang': 'text-only' } } diff --git a/swh/indexer/tests/test_metadata.py b/swh/indexer/tests/test_metadata.py --- a/swh/indexer/tests/test_metadata.py +++ b/swh/indexer/tests/test_metadata.py @@ -23,7 +23,6 @@ self.idx_storage = MockIndexerStorage() self.log = logging.getLogger('swh.indexer') self.objstorage = MockObjStorage() - self.destination_task = None self.tools = self.register_tools(self.config['tools']) self.tool = self.tools[0] self.results = [] @@ -57,7 +56,6 @@ self.idx_storage = MockIndexerStorage() self.log = logging.getLogger('swh.indexer') self.objstorage = MockObjStorage() - self.destination_task = None self.tools = self.register_tools(self.config['tools']) self.tool = self.tools[0] self.results = [] @@ -339,7 +337,7 @@ "contIntegration": "https://travis-ci.org/codemeta/codemeta", "developmentStatus": "active", "downloadUrl": "https://github.com/codemeta/codemeta/archive/2.0.zip", - "funder": { + "funder": { "@id": "https://doi.org/10.13039/100000001", "@type": "Organization", "name": "National Science Foundation" diff --git a/swh/indexer/tests/test_mimetype.py b/swh/indexer/tests/test_mimetype.py --- a/swh/indexer/tests/test_mimetype.py +++ b/swh/indexer/tests/test_mimetype.py @@ -53,22 +53,23 @@ self.id0 = '01c9379dfc33803963d07c1ccc748d3fe4c96bb5' self.id1 = '688a5ef812c53907562fe379d4b3851e69c7cb15' self.id2 = 'da39a3ee5e6b4b0d3255bfef95601890afd80709' + tool_id = self.indexer.tool['id'] self.expected_results = { self.id0: { 'id': self.id0, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'mimetype': b'text/plain', 'encoding': b'us-ascii', }, self.id1: { 'id': self.id1, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'mimetype': b'text/plain', 'encoding': b'us-ascii', }, self.id2: { 'id': self.id2, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'mimetype': b'application/x-empty', 'encoding': b'binary', } @@ -124,21 +125,23 @@ self.id0 = '01c9379dfc33803963d07c1ccc748d3fe4c96bb5' self.id1 = '02fb2c89e14f7fab46701478c83779c7beb7b069' self.id2 = '103bc087db1d26afc3a0283f38663d081e9b01e6' + tool_id = self.indexer.tool['id'] + self.expected_results = { self.id0: { 'encoding': b'us-ascii', 'id': self.id0, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'mimetype': b'text/plain'}, self.id1: { 'encoding': b'us-ascii', 'id': self.id1, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'mimetype': b'text/x-python'}, self.id2: { 'encoding': b'us-ascii', 'id': self.id2, - 'indexer_configuration_id': 10, + 'indexer_configuration_id': tool_id, 'mimetype': b'text/plain'} } diff --git a/swh/indexer/tests/test_origin_metadata.py b/swh/indexer/tests/test_origin_metadata.py --- a/swh/indexer/tests/test_origin_metadata.py +++ b/swh/indexer/tests/test_origin_metadata.py @@ -36,7 +36,6 @@ self.idx_storage = MockIndexerStorage() self.log = logging.getLogger('swh.indexer') self.objstorage = MockObjStorage() - self.destination_task = None self.tools = self.register_tools(self.config['tools']) self.tool = self.tools[0] self.results = []