MCPcopy
hub / github.com/conda/conda / test_tmpDownload

Function test_tmpDownload

tests/test_fetch.py:85–101  ·  view source on GitHub ↗
(monkeypatch: MonkeyPatch)

Source from the content-addressed store, hash-verified

83
84@pytest.mark.integration
85def test_tmpDownload(monkeypatch: MonkeyPatch):
86 monkeypatch.setenv("CONDA_REMOTE_CONNECT_TIMEOUT_SECS", "1")
87 monkeypatch.setenv("CONDA_REMOTE_READ_TIMEOUT_SECS", "1")
88 monkeypatch.setenv("CONDA_REMOTE_MAX_RETRIES", "1")
89 reset_context()
90 assert context.remote_connect_timeout_secs == 1
91 assert context.remote_read_timeout_secs == 1
92 assert context.remote_max_retries == 1
93
94 url = "https://repo.anaconda.com/pkgs/free/osx-64/appscript-1.0.1-py27_0.tar.bz2"
95 with TmpDownload(url) as dst:
96 assert exists(dst)
97 assert isfile(dst)
98
99 msg = "Rock and Roll Never Die"
100 with TmpDownload(msg) as result:
101 assert result == msg
102
103
104@responses.activate

Callers

nothing calls this directly

Calls 2

reset_contextFunction · 0.90
TmpDownloadClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…