diff --git a/swh/indexer/tests/storage/test_converters.py b/swh/indexer/tests/storage/test_converters.py --- a/swh/indexer/tests/storage/test_converters.py +++ b/swh/indexer/tests/storage/test_converters.py @@ -6,7 +6,7 @@ from swh.indexer.storage import converters -def test_ctags_to_db(): +def test_ctags_to_db() -> None: input_ctag = { "id": b"some-id", "indexer_configuration_id": 100, @@ -42,7 +42,7 @@ assert actual_ctags == expected_ctags -def test_db_to_ctags(): +def test_db_to_ctags() -> None: input_ctags = { "id": b"some-id", "name": "some-name", @@ -75,7 +75,7 @@ assert actual_ctags == expected_ctags -def test_db_to_mimetype(): +def test_db_to_mimetype() -> None: input_mimetype = { "id": b"some-id", "tool_id": 10, @@ -103,7 +103,7 @@ assert actual_mimetype == expected_mimetype -def test_db_to_language(): +def test_db_to_language() -> None: input_language = { "id": b"some-id", "tool_id": 20, @@ -129,7 +129,7 @@ assert actual_language == expected_language -def test_db_to_fossology_license(): +def test_db_to_fossology_license() -> None: input_license = { "id": b"some-id", "tool_id": 20, @@ -149,7 +149,7 @@ assert actual_license == expected_license -def test_db_to_metadata(): +def test_db_to_metadata() -> None: input_metadata = { "id": b"some-id", "tool_id": 20, diff --git a/swh/indexer/tests/storage/test_metrics.py b/swh/indexer/tests/storage/test_metrics.py --- a/swh/indexer/tests/storage/test_metrics.py +++ b/swh/indexer/tests/storage/test_metrics.py @@ -12,20 +12,20 @@ ) -def test_send_metric_unknown_unit(): +def test_send_metric_unknown_unit() -> None: r = send_metric("content", count=10, method_name="content_add") assert r is False r = send_metric("sthg:add:bytes:extra", count=10, method_name="sthg_add") assert r is False -def test_send_metric_no_value(): +def test_send_metric_no_value() -> None: r = send_metric("content_mimetype:add", count=0, method_name="content_mimetype_add") assert r is False @patch("swh.indexer.storage.metrics.statsd.increment") -def test_send_metric_no_unit(mock_statsd): +def test_send_metric_no_unit(mock_statsd) -> None: r = send_metric( "content_mimetype:add", count=10, method_name="content_mimetype_add" ) @@ -44,7 +44,7 @@ @patch("swh.indexer.storage.metrics.statsd.increment") -def test_send_metric_unit(mock_statsd): +def test_send_metric_unit(mock_statsd) -> None: unit_ = "bytes" r = send_metric("c:add:%s" % unit_, count=100, method_name="c_add") diff --git a/swh/indexer/tests/storage/test_server.py b/swh/indexer/tests/storage/test_server.py --- a/swh/indexer/tests/storage/test_server.py +++ b/swh/indexer/tests/storage/test_server.py @@ -9,7 +9,7 @@ from swh.indexer.storage.api.server import load_and_check_config -def prepare_config_file(tmpdir, content, name="config.yml"): +def prepare_config_file(tmpdir, content, name="config.yml") -> str: """Prepare configuration file in `$tmpdir/name` with content `content`. Args: @@ -31,7 +31,7 @@ return str(config_path) -def test_load_and_check_config_no_configuration(): +def test_load_and_check_config_no_configuration() -> None: """Inexistent configuration files raises""" with pytest.raises(EnvironmentError) as e: load_and_check_config(None) @@ -45,7 +45,7 @@ assert e.value.args[0] == "Configuration file %s does not exist" % (config_path,) -def test_load_and_check_config_wrong_configuration(tmpdir): +def test_load_and_check_config_wrong_configuration(tmpdir) -> None: """Wrong configuration raises""" config_path = prepare_config_file(tmpdir, "something: useless") with pytest.raises(KeyError) as e: @@ -54,7 +54,7 @@ assert e.value.args[0] == "Missing '%indexer_storage' configuration" -def test_load_and_check_config_remote_config_local_type_raise(tmpdir): +def test_load_and_check_config_remote_config_local_type_raise(tmpdir) -> None: """'local' configuration without 'local' storage raises""" config = {"indexer_storage": {"cls": "remote", "args": {}}} config_path = prepare_config_file(tmpdir, config) @@ -68,7 +68,7 @@ ) -def test_load_and_check_config_local_incomplete_configuration(tmpdir): +def test_load_and_check_config_local_incomplete_configuration(tmpdir) -> None: """Incomplete 'local' configuration should raise""" config = {"indexer_storage": {"cls": "local", "args": {}}} @@ -79,7 +79,7 @@ assert e.value.args[0] == "Invalid configuration; missing 'db' config entry" -def test_load_and_check_config_local_config_fine(tmpdir): +def test_load_and_check_config_local_config_fine(tmpdir) -> None: """'Remote configuration is fine""" config = {"indexer_storage": {"cls": "local", "args": {"db": "db",}}} config_path = prepare_config_file(tmpdir, config) @@ -87,7 +87,7 @@ assert cfg == config -def test_load_and_check_config_remote_config_fine(tmpdir): +def test_load_and_check_config_remote_config_fine(tmpdir) -> None: """'Remote configuration is fine""" config = {"indexer_storage": {"cls": "remote", "args": {}}} config_path = prepare_config_file(tmpdir, config) diff --git a/swh/indexer/tests/storage/test_storage.py b/swh/indexer/tests/storage/test_storage.py --- a/swh/indexer/tests/storage/test_storage.py +++ b/swh/indexer/tests/storage/test_storage.py @@ -6,7 +6,7 @@ import inspect import math import threading -from typing import Callable, Dict, Union +from typing import Any, Dict, List, Tuple, Union import pytest @@ -16,7 +16,7 @@ from swh.model.hashutil import hash_to_bytes -def prepare_mimetypes_from(fossology_licenses): +def prepare_mimetypes_from(fossology_licenses: List[Dict]) -> List[ContentMimetypeRow]: """Fossology license needs some consistent data in db to run. """ @@ -65,12 +65,12 @@ return {key: count} -def test_check_config(swh_indexer_storage): +def test_check_config(swh_indexer_storage) -> None: assert swh_indexer_storage.check_config(check_write=True) assert swh_indexer_storage.check_config(check_write=False) -def test_types(swh_indexer_storage): +def test_types(swh_indexer_storage) -> None: """Checks all methods of StorageInterface are implemented by this backend, and that they have the same signature.""" # Create an instance of the protocol (which cannot be instantiated @@ -111,19 +111,26 @@ See below for example usage. """ + endpoint_type: str + tool_name: str + example_data: List[Dict] + # For old endpoints (which use dicts), this is just the identity function. # For new endpoints, it returns a BaseRow instance. - row_from_dict: Callable[[Dict], Union[Dict, BaseRow]] = ( - staticmethod(lambda x: x) # type: ignore - ) + @staticmethod + def row_from_dict(d: Dict) -> Union[Dict, BaseRow]: + return d # Inverse function of row_from_dict # TODO: remove this once all endpoints are migrated to rows - dict_from_row: Callable[[Union[Dict, BaseRow]], Dict] = ( - staticmethod(lambda x: x) # type: ignore - ) - - def test_missing(self, swh_indexer_storage_with_data): + @staticmethod + def dict_from_row(r: Union[Dict, BaseRow]) -> Dict: + assert isinstance(r, Dict) + return r + + def test_missing( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool_id = data.tools[self.tool_name]["id"] @@ -160,7 +167,9 @@ actual_missing = endpoint(storage, etype, "missing")(query) assert list(actual_missing) == [data.sha1_1] - def test_add__drop_duplicate(self, swh_indexer_storage_with_data): + def test_add__drop_duplicate( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool_id = data.tools[self.tool_name]["id"] @@ -197,7 +206,9 @@ actual_data = list(endpoint(storage, etype, "get")([data.sha1_2])) assert actual_data == expected_data_v1 - def test_add__update_in_place_duplicate(self, swh_indexer_storage_with_data): + def test_add__update_in_place_duplicate( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -244,7 +255,9 @@ # data did change as the v2 was used to overwrite v1 assert actual_data == expected_data_v2 - def test_add__update_in_place_deadlock(self, swh_indexer_storage_with_data): + def test_add__update_in_place_deadlock( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -295,10 +308,10 @@ assert actual_data == expected_data_v1 # given - def f1(): + def f1() -> None: endpoint(storage, etype, "add")(data_v2a, conflict_update=True) - def f2(): + def f2() -> None: endpoint(storage, etype, "add")(data_v2b, conflict_update=True) t1 = threading.Thread(target=f1) @@ -320,7 +333,9 @@ assert actual_data == expected_data_v2 - def test_add__duplicate_twice(self, swh_indexer_storage_with_data): + def test_add__duplicate_twice( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -362,7 +377,9 @@ ] assert actual_data == expected_data - def test_get(self, swh_indexer_storage_with_data): + def test_get( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -406,20 +423,22 @@ row_from_dict = ContentMimetypeRow.from_dict dict_from_row = staticmethod(lambda x: x.to_dict()) # type: ignore - def test_generate_content_mimetype_get_partition_failure(self, swh_indexer_storage): + def test_generate_content_mimetype_get_partition_failure( + self, swh_indexer_storage: IndexerStorageInterface + ) -> None: """get_partition call with wrong limit input should fail""" storage = swh_indexer_storage - indexer_configuration_id = None + indexer_configuration_id = 42 with pytest.raises( IndexerStorageArgumentException, match="limit should not be None" ): storage.content_mimetype_get_partition( - indexer_configuration_id, 0, 3, limit=None + indexer_configuration_id, 0, 3, limit=None # type: ignore ) def test_generate_content_mimetype_get_partition_no_limit( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition should return result""" storage, data = swh_indexer_storage_with_data mimetypes = data.mimetypes @@ -443,8 +462,8 @@ assert actual_id in expected_ids def test_generate_content_mimetype_get_partition_full( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition for a single partition should return available ids """ @@ -463,8 +482,8 @@ assert actual_id in expected_ids def test_generate_content_mimetype_get_partition_empty( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition when at least one of the partitions is empty""" storage, data = swh_indexer_storage_with_data mimetypes = data.mimetypes @@ -495,8 +514,8 @@ assert set(seen_ids) == expected_ids def test_generate_content_mimetype_get_partition_with_pagination( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition should return ids provided with pagination """ @@ -581,7 +600,9 @@ def test_get(self): pass - def test_content_ctags_search(self, swh_indexer_storage_with_data): + def test_content_ctags_search( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # 1. given tool = data.tools["universal-ctags"] @@ -701,15 +722,17 @@ } ] - def test_content_ctags_search_no_result(self, swh_indexer_storage): + def test_content_ctags_search_no_result( + self, swh_indexer_storage: IndexerStorageInterface + ) -> None: storage = swh_indexer_storage actual_ctags = list(storage.content_ctags_search("counter")) assert not actual_ctags def test_content_ctags_add__add_new_ctags_added( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given @@ -780,7 +803,9 @@ assert actual_ctags == expected_ctags - def test_content_ctags_add__update_in_place(self, swh_indexer_storage_with_data): + def test_content_ctags_add__update_in_place( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool = data.tools["universal-ctags"] @@ -859,7 +884,9 @@ ] assert actual_ctags == expected_ctags - def test_add_empty(self, swh_indexer_storage_with_data): + def test_add_empty( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: (storage, data) = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -873,7 +900,9 @@ assert actual_ctags == [] - def test_get_unknown(self, swh_indexer_storage_with_data): + def test_get_unknown( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: (storage, data) = swh_indexer_storage_with_data etype = self.endpoint_type @@ -931,7 +960,9 @@ }, ] - def test_revision_intrinsic_metadata_delete(self, swh_indexer_storage_with_data): + def test_revision_intrinsic_metadata_delete( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -959,8 +990,8 @@ assert not actual_data def test_revision_intrinsic_metadata_delete_nonexisting( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -974,8 +1005,8 @@ tool_name = "nomos" def test_content_fossology_license_add__new_license_added( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool = data.tools["nomos"] @@ -1017,21 +1048,21 @@ assert actual_licenses == [expected_license] def test_generate_content_fossology_license_get_partition_failure( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition call with wrong limit input should fail""" storage, data = swh_indexer_storage_with_data - indexer_configuration_id = None + indexer_configuration_id = 42 with pytest.raises( IndexerStorageArgumentException, match="limit should not be None" ): storage.content_fossology_license_get_partition( - indexer_configuration_id, 0, 3, limit=None, + indexer_configuration_id, 0, 3, limit=None, # type: ignore ) def test_generate_content_fossology_license_get_partition_no_limit( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition should return results""" storage, data = swh_indexer_storage_with_data # craft some consistent mimetypes @@ -1064,8 +1095,8 @@ assert actual_id in expected_ids def test_generate_content_fossology_license_get_partition_full( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition for a single partition should return available ids """ @@ -1092,8 +1123,8 @@ assert actual_id in expected_ids def test_generate_content_fossology_license_get_partition_empty( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition when at least one of the partitions is empty""" storage, data = swh_indexer_storage_with_data # craft some consistent mimetypes @@ -1132,8 +1163,8 @@ assert set(seen_ids) == expected_ids def test_generate_content_fossology_license_get_partition_with_pagination( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: """get_partition should return ids provided with paginationv """ @@ -1172,7 +1203,9 @@ for actual_id in actual_ids: assert actual_id in expected_ids - def test_add_empty(self, swh_indexer_storage_with_data): + def test_add_empty( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: (storage, data) = swh_indexer_storage_with_data etype = self.endpoint_type tool = data.tools[self.tool_name] @@ -1192,7 +1225,9 @@ assert actual_license == [] - def test_get_unknown(self, swh_indexer_storage_with_data): + def test_get_unknown( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: (storage, data) = swh_indexer_storage_with_data etype = self.endpoint_type @@ -1202,7 +1237,9 @@ class TestIndexerStorageOriginIntrinsicMetadata: - def test_origin_intrinsic_metadata_get(self, swh_indexer_storage_with_data): + def test_origin_intrinsic_metadata_get( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] @@ -1246,7 +1283,9 @@ assert actual_metadata == expected_metadata - def test_origin_intrinsic_metadata_delete(self, swh_indexer_storage_with_data): + def test_origin_intrinsic_metadata_delete( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] @@ -1290,8 +1329,8 @@ assert actual_metadata == [metadata_origin2] def test_origin_intrinsic_metadata_delete_nonexisting( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool_id = data.tools["swh-metadata-detector"]["id"] storage.origin_intrinsic_metadata_delete( @@ -1299,13 +1338,13 @@ ) def test_origin_intrinsic_metadata_add_drop_duplicate( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] - metadata_v1 = { + metadata_v1: Dict[str, Any] = { "version": None, "name": None, } @@ -1366,13 +1405,13 @@ assert actual_metadata == expected_metadata_v1 def test_origin_intrinsic_metadata_add_update_in_place_duplicate( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] - metadata_v1 = { + metadata_v1: Dict[str, Any] = { "version": None, "name": None, } @@ -1450,8 +1489,8 @@ assert actual_metadata == expected_metadata_v2 def test_origin_intrinsic_metadata_add__update_in_place_deadlock( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] @@ -1520,10 +1559,10 @@ assert actual_data == expected_data_v1 # given - def f1(): + def f1() -> None: storage.origin_intrinsic_metadata_add(data_v2a, conflict_update=True) - def f2(): + def f2() -> None: storage.origin_intrinsic_metadata_add(data_v2b, conflict_update=True) t1 = threading.Thread(target=f1) @@ -1550,8 +1589,8 @@ assert sorted(actual_data, key=lambda x: x["id"]) == expected_data_v2 def test_origin_intrinsic_metadata_add__duplicate_twice( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] @@ -1581,8 +1620,8 @@ storage.origin_intrinsic_metadata_add([metadata_origin, metadata_origin]) def test_origin_intrinsic_metadata_search_fulltext( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] @@ -1636,8 +1675,8 @@ assert not list(search(["John", "Jane"])) def test_origin_intrinsic_metadata_search_fulltext_rank( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data # given tool_id = data.tools["swh-metadata-detector"]["id"] @@ -1695,7 +1734,9 @@ ] assert [res["id"] for res in search(["John", "Jane"])] == [data.origin_url_1] - def _fill_origin_intrinsic_metadata(self, swh_indexer_storage_with_data): + def _fill_origin_intrinsic_metadata( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool1_id = data.tools["swh-metadata-detector"]["id"] tool2_id = data.tools["swh-metadata-detector2"]["id"] @@ -1759,8 +1800,8 @@ storage.origin_intrinsic_metadata_add([metadata3_origin]) def test_origin_intrinsic_metadata_search_by_producer( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data self._fill_origin_intrinsic_metadata(swh_indexer_storage_with_data) tool1 = data.tools["swh-metadata-detector"] @@ -1858,7 +1899,9 @@ } ] - def test_origin_intrinsic_metadata_stats(self, swh_indexer_storage_with_data): + def test_origin_intrinsic_metadata_stats( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data self._fill_origin_intrinsic_metadata(swh_indexer_storage_with_data) @@ -1877,7 +1920,9 @@ class TestIndexerStorageIndexerCondifuration: - def test_indexer_configuration_add(self, swh_indexer_storage_with_data): + def test_indexer_configuration_add( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool = { "tool_name": "some-unknown-tool", @@ -1905,7 +1950,9 @@ assert new_id == new_id2 assert actual_tool == actual_tool2 - def test_indexer_configuration_add_multiple(self, swh_indexer_storage_with_data): + def test_indexer_configuration_add_multiple( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool = { "tool_name": "some-unknown-tool", @@ -1934,7 +1981,9 @@ assert _id is not None assert tool in new_tools - def test_indexer_configuration_get_missing(self, swh_indexer_storage_with_data): + def test_indexer_configuration_get_missing( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool = { "tool_name": "unknown-tool", @@ -1946,7 +1995,9 @@ assert actual_tool is None - def test_indexer_configuration_get(self, swh_indexer_storage_with_data): + def test_indexer_configuration_get( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool = { "tool_name": "nomos", @@ -1963,8 +2014,8 @@ assert expected_tool == actual_tool def test_indexer_configuration_metadata_get_missing_context( - self, swh_indexer_storage_with_data - ): + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool = { "tool_name": "swh-metadata-translator", @@ -1976,7 +2027,9 @@ assert actual_tool is None - def test_indexer_configuration_metadata_get(self, swh_indexer_storage_with_data): + def test_indexer_configuration_metadata_get( + self, swh_indexer_storage_with_data: Tuple[IndexerStorageInterface, Any] + ) -> None: storage, data = swh_indexer_storage_with_data tool = { "tool_name": "swh-metadata-translator",