Skip to content

Commit 9a68d90

Browse files
committed
Add a regression test for small-file writes.
In conjunction with the existing large-file test, this one ensures that we exercise both the 'simple'/'media' upload API, and the 'resumable' one.
1 parent 0416e93 commit 9a68d90

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

regression/storage.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ def test_large_file_write_from_stream(self):
123123
key._properties.clear() # force a reload
124124
self.assertEqual(key.md5_hash, file_data['hash'])
125125

126+
def test_small_file_write_from_filename(self):
127+
key = self.bucket.new_key('LargeFile')
128+
self.assertEqual(key._properties, {})
129+
130+
file_data = self.FILES['simple']
131+
key.upload_from_filename(file_data['path'])
132+
self.case_keys_to_delete.append(key)
133+
134+
key._properties.clear() # force a reload
135+
self.assertEqual(key.md5_hash, file_data['hash'])
136+
126137
def test_write_metadata(self):
127138
key = self.bucket.upload_file(self.FILES['logo']['path'])
128139
self.case_keys_to_delete.append(key)

0 commit comments

Comments
 (0)