Skip to content

Commit

Permalink
test(stream_io): add test for test_download_url
Browse files Browse the repository at this point in the history
Signed-off-by: Robin H. Johnson <[email protected]>
  • Loading branch information
robbat2 committed Jul 31, 2023
1 parent 268d4af commit 94c2867
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_stream_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ def test_upload(self):
s.close()
self.assert_bucket_contents(key, long_string)

def test_download_url(self):
# s3_download_url does interesting things with passing a config, so
# needs specific test handling.
with mock_server() as endpoint:
key = "model.tensors"
with stream_io.s3_download_url(
path_uri=f"s3://{self.BUCKET_NAME}/{key}",
s3_access_key_id="X",
s3_secret_access_key="X",
s3_endpoint=endpoint,
) as s:
print(s)
self.assertEqual(s, 'DEBUG')

def test_download(self):
# CURLStreamFiles ignore moto's normal mocks, since moto still
# generates a real URL when a real endpoint is used, so instead
Expand Down

0 comments on commit 94c2867

Please sign in to comment.