From e030a8c34b75a0da55d6e7ec948a3b8a861050ea Mon Sep 17 00:00:00 2001 From: "Thomas J. Zajac" Date: Tue, 1 Oct 2024 08:22:19 +0000 Subject: [PATCH] Requested changes --- example_config.yaml | 2 +- openapi.yaml | 4 ++-- src/dins/core/information_service.py | 6 ++---- tests/test_typical_journey.py | 4 ++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/example_config.yaml b/example_config.yaml index ff17a9f..04e4094 100644 --- a/example_config.yaml +++ b/example_config.yaml @@ -5,7 +5,7 @@ cors_allowed_headers: null cors_allowed_methods: null cors_allowed_origins: null db_connection_str: '**********' -db_name: dev_db +db_name: dev docs_url: /docs file_registered_event_topic: internal_file_registry file_registered_event_type: file_registered diff --git a/openapi.yaml b/openapi.yaml index dcb2d6b..74cbbcd 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -11,8 +11,8 @@ components: title: File Id type: string sha256_hash: - description: SHA256 hash of the unencrypted file content encoded as hexadecimal values - as produced by hashlib.hexdigest(). + description: SHA256 hash of the unencrypted file content encoded as hexadecimal + values as produced by hashlib.hexdigest(). title: Sha256 Hash type: string size: diff --git a/src/dins/core/information_service.py b/src/dins/core/information_service.py index 79cd65f..495ef0f 100644 --- a/src/dins/core/information_service.py +++ b/src/dins/core/information_service.py @@ -40,8 +40,7 @@ async def deletion_requested(self, file_id: str): await self._file_information_dao.get_by_id(id_=file_id) except ResourceNotFoundError: log.info( - f"Information for file with id '{ - file_id}' has already been deleted." + f"Information for file with id '{file_id}' has already been deleted." ) return @@ -78,8 +77,7 @@ async def serve_information(self, file_id: str) -> FileInformation: """Retrieve stored public information for the given file ID to be served by the API.""" try: file_information = await self._file_information_dao.get_by_id(file_id) - log.debug(f"Information for file { - file_information.file_id} found.") + log.debug(f"Information for file {file_information.file_id} found.") except ResourceNotFoundError as error: information_not_found = self.InformationNotFoundError(file_id=file_id) log.warning(information_not_found) diff --git a/tests/test_typical_journey.py b/tests/test_typical_journey.py index 49816a1..22a5375 100644 --- a/tests/test_typical_journey.py +++ b/tests/test_typical_journey.py @@ -92,8 +92,8 @@ async def test_normal_journey( assert expected_message in caplog.messages # Test reregistration of mismatching content - mismatch_message = f"Mismatching information for the file with ID { - file_id} has already been registered." + mismatch_message = f"Mismatching information for the file with ID {file_id}" + "has already been registered." mismatch_mock = INCOMING_PAYLOAD_MOCK.model_copy( update={"decrypted_sha256": "other-fake-checksum"} )