Skip to content

Commit

Permalink
[tests/gcloud] Fix mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mlazowik committed Mar 10, 2022
1 parent 57a592e commit 4ee9405
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_gcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_open_read(self):
self.storage._client.bucket.assert_called_with(self.bucket_name)
self.storage._bucket.get_blob.assert_called_with(self.filename, timeout=60)

f.blob.download_to_file = lambda tmpfile: tmpfile.write(data)
f.blob.download_to_file = lambda tmpfile, **kwargs: tmpfile.write(data)
self.assertEqual(f.read(), data)

def test_open_read_num_bytes(self):
Expand All @@ -51,7 +51,7 @@ def test_open_read_num_bytes(self):
self.storage._client.bucket.assert_called_with(self.bucket_name)
self.storage._bucket.get_blob.assert_called_with(self.filename, timeout=60)

f.blob.download_to_file = lambda tmpfile: tmpfile.write(data)
f.blob.download_to_file = lambda tmpfile, **kwargs: tmpfile.write(data)
self.assertEqual(f.read(num_bytes), data[0:num_bytes])

def test_open_read_nonexistent(self):
Expand Down

0 comments on commit 4ee9405

Please sign in to comment.