@@ -90,7 +90,7 @@ def test_get_simple_response_archive_to_http_scheme(
90
90
91
91
session .assert_has_calls (
92
92
[
93
- mock .call .head (url , allow_redirects = True ),
93
+ mock .call .head (url , allow_redirects = True , headers = None ),
94
94
]
95
95
)
96
96
mock_raise_for_status .assert_called_once_with (session .head .return_value )
@@ -152,7 +152,7 @@ def test_get_simple_response_archive_to_http_scheme_is_html(
152
152
153
153
assert resp is not None
154
154
assert session .mock_calls == [
155
- mock .call .head (url , allow_redirects = True ),
155
+ mock .call .head (url , allow_redirects = True , headers = None ),
156
156
mock .call .get (
157
157
url ,
158
158
headers = {
@@ -240,14 +240,19 @@ def test_get_simple_response_dont_log_clear_text_password(
240
240
assert resp is not None
241
241
mock_raise_for_status .assert_called_once_with (resp )
242
242
243
- assert len (caplog .records ) == 2
243
+ assert len (caplog .records ) == 3
244
244
record = caplog .records [0 ]
245
245
assert record .levelname == "DEBUG"
246
246
assert record .message .splitlines () == [
247
247
"Getting page https://user:****@example.com/simple/" ,
248
248
]
249
249
record = caplog .records [1 ]
250
250
assert record .levelname == "DEBUG"
251
+ assert record .message .splitlines () == [
252
+ "headers: None"
253
+ ]
254
+ record = caplog .records [2 ]
255
+ assert record .levelname == "DEBUG"
251
256
assert record .message .splitlines () == [
252
257
"Fetched page https://user:****@example.com/simple/ as text/html" ,
253
258
]
@@ -838,7 +843,7 @@ def test_get_index_content_directory_append_index(tmpdir: Path) -> None:
838
843
mock_func .return_value = fake_response
839
844
actual = _get_index_content (Link (dir_url ), session = session )
840
845
assert mock_func .mock_calls == [
841
- mock .call (expected_url , session = session ),
846
+ mock .call (expected_url , headers = None , session = session ),
842
847
], f"actual calls: { mock_func .mock_calls } "
843
848
844
849
assert actual is not None
@@ -957,6 +962,7 @@ def test_fetch_response(self, mock_get_simple_response: mock.Mock) -> None:
957
962
# _get_simple_response().
958
963
mock_get_simple_response .assert_called_once_with (
959
964
url ,
965
+ headers = None ,
960
966
session = link_collector .session ,
961
967
)
962
968
0 commit comments