fix(cleanup): use authoritative resource identities
test / integration-docker (pull_request) Has been cancelled
test / image-input-builds (pull_request) Failing after 14m4s
test / unit (pull_request) Failing after 14m8s
test / coverage (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Failing after 12m1s
test / integration-docker (pull_request) Has been cancelled
test / image-input-builds (pull_request) Failing after 14m4s
test / unit (pull_request) Failing after 14m8s
test / coverage (pull_request) Has been skipped
tracker-policy-pr / check-pr (pull_request) Failing after 12m1s
This commit is contained in:
@@ -284,6 +284,18 @@ class TestEnsureArtifact(_CacheMixin):
|
||||
ia.ensure_artifact_gz(version, role=_ROLE)
|
||||
self.assertEqual(first_calls, len(net.calls))
|
||||
|
||||
def test_download_uses_network_deadline(self) -> None:
|
||||
response = mock.MagicMock()
|
||||
response.__enter__.return_value = io.BytesIO(b"payload")
|
||||
with tempfile.TemporaryDirectory() as d, mock.patch.object(
|
||||
ia.urllib.request, "urlopen", return_value=response,
|
||||
) as urlopen:
|
||||
ia._download("https://registry/artifact", Path(d) / "artifact")
|
||||
self.assertEqual(
|
||||
ia.ARTIFACT_HTTP_TIMEOUT_SECONDS,
|
||||
urlopen.call_args.kwargs["timeout"],
|
||||
)
|
||||
|
||||
def test_checksum_mismatch_fails_closed(self) -> None:
|
||||
version = "beefbeefbeefbeef"
|
||||
gz = _gz(b"payload")
|
||||
|
||||
Reference in New Issue
Block a user