Skip to content

Commit

Permalink
Add the suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhwaniartefact committed Oct 18, 2024
1 parent 0d86364 commit 006811c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 2 additions & 1 deletion fixity/storage_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import calendar
import json
from datetime import datetime
from typing import Dict

import requests
from sqlalchemy.orm.exc import NoResultFound
Expand All @@ -23,7 +24,7 @@ class StorageServiceError(Exception):
itself will not return, but the caller still needs access to it.
"""

def __init__(self, message, report=None):
def __init__(self, message: str, report: Dict[str, str] = None) -> None:
self.report = report
super().__init__(message)

Expand Down
7 changes: 2 additions & 5 deletions tests/test_fixity.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,11 +652,8 @@ def test_main_handles_exception_if_environment_key_is_missing(

@mock.patch("requests.get")
def test_scanall_handles_exception_if_storage_service_is_not_connected(
_get: mock.Mock, monkeypatch: pytest.MonkeyPatch
_get: mock.Mock, environment: None
) -> None:
monkeypatch.setenv("STORAGE_SERVICE_URL", STORAGE_SERVICE_URL)
monkeypatch.setenv("STORAGE_SERVICE_USER", "")
monkeypatch.setenv("STORAGE_SERVICE_KEY", "")
aip_id1 = str(uuid.uuid4())
aip_id2 = str(uuid.uuid4())
_get.side_effect = [
Expand Down Expand Up @@ -687,6 +684,6 @@ def test_scanall_handles_exception_if_storage_service_is_not_connected(

fixity.main(["scanall"], stream=stream)

assert storage_service.StorageServiceError( # type: ignore
assert storage_service.StorageServiceError(
f'Storage service at "{STORAGE_SERVICE_URL}" failed authentication while requesting AIPs'
)

0 comments on commit 006811c

Please sign in to comment.