mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 05:04:38 +03:00
Update tests to require proper checksums
This commit is contained in:
@@ -331,3 +331,12 @@ def test_helper_getUrl_conn_error(monkeypatch):
|
||||
getUrl(url, timeout)
|
||||
assert e.type == ArchiveConnectionError
|
||||
assert expect_re.match(format(e.value))
|
||||
|
||||
|
||||
def test_helper_getUrl_checksum_error(monkeypatch):
|
||||
mocked_get, mocked_session_get = mock_get_redirect(0)
|
||||
monkeypatch.setattr(requests, "get", mocked_get)
|
||||
monkeypatch.setattr(requests.Session, "get", mocked_session_get)
|
||||
with pytest.raises(ArchiveChecksumError) as e:
|
||||
getUrl("some_url", timeout=(5, 5), expected_hash=b"AAAAAAAAAAA")
|
||||
assert e.type == ArchiveChecksumError
|
||||
|
||||
Reference in New Issue
Block a user