Merge pull request #2706 from coreos-inc/zero-chunk-test

Add a zero chunk test to cloud storage
This commit is contained in:
josephschorr 2017-06-16 13:42:51 -04:00 committed by GitHub
commit 37a6f1f5d9

View file

@ -84,6 +84,9 @@ class TestCloudStorage(unittest.TestCase):
self.engine.stream_write(_TEST_PATH, StringIO(new_data), content_type='Cool/Type') self.engine.stream_write(_TEST_PATH, StringIO(new_data), content_type='Cool/Type')
self.assertEquals(new_data, self.engine.get_content(_TEST_PATH)) self.assertEquals(new_data, self.engine.get_content(_TEST_PATH))
def test_chunked_upload_no_chunks(self):
self._chunk_upload_test(0)
def test_chunked_upload_single_chunk(self): def test_chunked_upload_single_chunk(self):
self._chunk_upload_test(1) self._chunk_upload_test(1)
@ -114,7 +117,7 @@ class TestCloudStorage(unittest.TestCase):
self.assertEquals(index + 1, len(metadata[_CHUNKS_KEY])) self.assertEquals(index + 1, len(metadata[_CHUNKS_KEY]))
# Complete the chunked upload. # Complete the chunked upload.
self.engine.complete_chunked_upload(upload_id, 'some/chunked/path', new_metadata, self.engine.complete_chunked_upload(upload_id, 'some/chunked/path', metadata,
force_client_side=force_client_side) force_client_side=force_client_side)
# Ensure the file contents are valid. # Ensure the file contents are valid.