3
3
import uuid
4
4
from datetime import datetime
5
5
from datetime import timezone
6
- from typing import List
7
6
from typing import TextIO
8
7
from unittest import mock
9
8
@@ -45,7 +44,7 @@ def environment(monkeypatch: pytest.MonkeyPatch) -> None:
45
44
46
45
47
46
@pytest .fixture
48
- def mock_check_fixity () -> List [mock .Mock ]:
47
+ def mock_check_fixity () -> list [mock .Mock ]:
49
48
return [
50
49
mock .Mock (
51
50
** {
@@ -58,14 +57,14 @@ def mock_check_fixity() -> List[mock.Mock]:
58
57
]
59
58
60
59
61
- def _assert_stream_content_matches (stream : TextIO , expected : List [str ]) -> None :
60
+ def _assert_stream_content_matches (stream : TextIO , expected : list [str ]) -> None :
62
61
stream .seek (0 )
63
62
assert [line .strip () for line in stream .readlines ()] == expected
64
63
65
64
66
65
@mock .patch ("requests.get" )
67
66
def test_scan (
68
- _get : mock .Mock , environment : None , mock_check_fixity : List [mock .Mock ]
67
+ _get : mock .Mock , environment : None , mock_check_fixity : list [mock .Mock ]
69
68
) -> None :
70
69
_get .side_effect = mock_check_fixity
71
70
aip_id = uuid .uuid4 ()
@@ -95,7 +94,7 @@ def test_scan_if_timestamps_argument_is_passed(
95
94
_get : mock .Mock ,
96
95
time : mock .Mock ,
97
96
environment : None ,
98
- mock_check_fixity : List [mock .Mock ],
97
+ mock_check_fixity : list [mock .Mock ],
99
98
) -> None :
100
99
_get .side_effect = mock_check_fixity
101
100
aip_id = uuid .uuid4 ()
@@ -140,7 +139,7 @@ def test_scan_if_report_url_exists(
140
139
utcnow : mock .Mock ,
141
140
uuid4 : mock .Mock ,
142
141
environment : None ,
143
- mock_check_fixity : List [mock .Mock ],
142
+ mock_check_fixity : list [mock .Mock ],
144
143
monkeypatch : pytest .MonkeyPatch ,
145
144
) -> None :
146
145
uuid4 .return_value = expected_uuid = uuid .uuid4 ()
@@ -215,7 +214,7 @@ def test_scan_handles_exceptions_if_report_url_exists(
215
214
_post : mock .Mock ,
216
215
_get : mock .Mock ,
217
216
environment : None ,
218
- mock_check_fixity : List [mock .Mock ],
217
+ mock_check_fixity : list [mock .Mock ],
219
218
monkeypatch : pytest .MonkeyPatch ,
220
219
) -> None :
221
220
_get .side_effect = mock_check_fixity
@@ -328,7 +327,7 @@ def test_scan_message(status: bool, error_message: str) -> None:
328
327
"requests.get" ,
329
328
)
330
329
def test_scanall (
331
- _get : mock .Mock , environment : None , mock_check_fixity : List [mock .Mock ]
330
+ _get : mock .Mock , environment : None , mock_check_fixity : list [mock .Mock ]
332
331
) -> None :
333
332
aip1_uuid = str (uuid .uuid4 ())
334
333
aip2_uuid = str (uuid .uuid4 ())
@@ -499,7 +498,7 @@ def test_main_handles_exceptions_if_scanall_fails(
499
498
500
499
@mock .patch ("requests.get" )
501
500
def test_scanall_if_sort_argument_is_passed (
502
- _get : mock .Mock , environment : None , mock_check_fixity : List [mock .Mock ]
501
+ _get : mock .Mock , environment : None , mock_check_fixity : list [mock .Mock ]
503
502
) -> None :
504
503
aip1_uuid = str (uuid .uuid4 ())
505
504
aip2_uuid = str (uuid .uuid4 ())
@@ -640,7 +639,7 @@ def test_scanall_if_sort_argument_is_passed(
640
639
641
640
@mock .patch ("requests.get" )
642
641
def test_main_handles_exception_if_environment_key_is_missing (
643
- _get : mock .Mock , mock_check_fixity : List [mock .Mock ]
642
+ _get : mock .Mock , mock_check_fixity : list [mock .Mock ]
644
643
) -> None :
645
644
_get .side_effect = mock_check_fixity
646
645
0 commit comments