Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def _resource(name):
}


def _fake_send(url, no_ssl, config):
def _fake_send(url, no_ssl, config, method="GET"):
if method == "HEAD":
return Response(b"", 200 if _fake_is_live(url) else 404, url)
canned = CANNED_RESPONSES.get(url)
if canned is None:
return None
Expand All @@ -97,8 +99,6 @@ def _fake_is_live(url, config=None):
def mock_network(monkeypatch):
monkeypatch.setattr(dl, "_send_urllib_request", _fake_send)
monkeypatch.setattr(dl, "_send_pycurl_request", _fake_send)
monkeypatch.setattr(dl, "_urllib3_is_live_page", _fake_is_live)
monkeypatch.setattr(dl, "_pycurl_is_live_page", _fake_is_live)


def _zero_sleep(config):
Expand Down
Loading
Loading