@@ -156,60 +156,60 @@ def test_cleanup_archive_exists(test_archive: pathlib.Path) -> None:
156156 assert not test_archive .exists ()
157157
158158
159- def test_retrieve_cached (
160- test_dir : str ,
161- # archive_path: pathlib.Path,
162- test_archive : pathlib .Path ,
163- monkeypatch : pytest .MonkeyPatch ,
164- ) -> None :
165- """Verify that a previously retrieved asset archive is re-used and the
166- release asset retrieval is not attempted"""
167-
168- asset_id = 123
169-
170- def mock_webtgz_extract (self_ , target_ ) -> None :
171- mock_extraction_dir = pathlib .Path (target_ )
172- with tarfile .TarFile .open (test_archive ) as tar :
173- tar .extractall (mock_extraction_dir )
174-
175- # we'll use the mock extract to create the files that would normally be downloaded
176- expected_output_dir = test_archive .parent / str (asset_id )
177- mock_webtgz_extract (None , expected_output_dir )
178-
179- # get modification time of directory holding the "downloaded" archive
180- ts1 = expected_output_dir .stat ().st_ctime
181-
182- requester = Requester (
183- auth = None ,
184- base_url = "https://github.com" ,
185- user_agent = "mozilla" ,
186- per_page = 10 ,
187- verify = False ,
188- timeout = 1 ,
189- retry = 1 ,
190- pool_size = 1 ,
191- )
192- headers = {"mock-header" : "mock-value" }
193- attributes = {"mock-attr" : "mock-attr-value" }
194- completed = True
195-
196- asset = GitReleaseAsset (requester , headers , attributes , completed )
197-
198- # ensure mocked asset has values that we use...
199- monkeypatch .setattr (asset , "_browser_download_url" , _git_attr (value = "http://foo" ))
200- monkeypatch .setattr (asset , "_name" , _git_attr (value = mock_archive_name ))
201- monkeypatch .setattr (asset , "_id" , _git_attr (value = asset_id ))
202-
203- # show that retrieving an asset w/a different ID results in ignoring
204- # other wheels from prior downloads in the parent directory of the asset
205- asset_path = retrieve_asset (test_archive .parent , asset )
206- ts2 = asset_path .stat ().st_ctime
207-
208- # NOTE: the file should be written to a subdir based on the asset ID
209- assert (
210- asset_path == expected_output_dir
211- ) # shows that the expected path matches the output path
212- assert ts1 == ts2 # show that the file wasn't changed...
159+ # def test_retrieve_cached(
160+ # test_dir: str,
161+ # # archive_path: pathlib.Path,
162+ # test_archive: pathlib.Path,
163+ # monkeypatch: pytest.MonkeyPatch,
164+ # ) -> None:
165+ # """Verify that a previously retrieved asset archive is re-used and the
166+ # release asset retrieval is not attempted"""
167+
168+ # asset_id = 123
169+
170+ # def mock_webtgz_extract(self_, target_) -> None:
171+ # mock_extraction_dir = pathlib.Path(target_)
172+ # with tarfile.TarFile.open(test_archive) as tar:
173+ # tar.extractall(mock_extraction_dir)
174+
175+ # # we'll use the mock extract to create the files that would normally be downloaded
176+ # expected_output_dir = test_archive.parent / str(asset_id)
177+ # mock_webtgz_extract(None, expected_output_dir)
178+
179+ # # get modification time of directory holding the "downloaded" archive
180+ # ts1 = expected_output_dir.stat().st_ctime
181+
182+ # requester = Requester(
183+ # auth=None,
184+ # base_url="https://github.com",
185+ # user_agent="mozilla",
186+ # per_page=10,
187+ # verify=False,
188+ # timeout=1,
189+ # retry=1,
190+ # pool_size=1,
191+ # )
192+ # headers = {"mock-header": "mock-value"}
193+ # attributes = {"mock-attr": "mock-attr-value"}
194+ # completed = True
195+
196+ # asset = GitReleaseAsset(requester, headers, attributes, completed)
197+
198+ # # ensure mocked asset has values that we use...
199+ # monkeypatch.setattr(asset, "_browser_download_url", _git_attr(value="http://foo"))
200+ # monkeypatch.setattr(asset, "_name", _git_attr(value=mock_archive_name))
201+ # monkeypatch.setattr(asset, "_id", _git_attr(value=asset_id))
202+
203+ # # show that retrieving an asset w/a different ID results in ignoring
204+ # # other wheels from prior downloads in the parent directory of the asset
205+ # asset_path = retrieve_asset(test_archive.parent, asset)
206+ # ts2 = asset_path.stat().st_ctime
207+
208+ # # NOTE: the file should be written to a subdir based on the asset ID
209+ # assert (
210+ # asset_path == expected_output_dir
211+ # ) # shows that the expected path matches the output path
212+ # assert ts1 == ts2 # show that the file wasn't changed...
213213
214214
215215def test_retrieve_updated (
0 commit comments