Skip to content

Commit

Permalink
Update functional tests based on feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
aemous committed Sep 30, 2024
1 parent 82286ca commit 870e739
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/functional/s3/test_sync_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ def test_upload_with_checksum_algorithm_sha256(self):

def test_download_with_checksum_mode_sha1(self):
self.parsed_responses = [
self.head_object_response(),
self.list_objects_response(['bucket']),
# Mocked GetObject response with an included checksum algorithm specified
{
'ContentLength': '100',
'LastModified': '00:00:00Z',
Expand All @@ -426,10 +427,13 @@ def test_download_with_checksum_mode_sha1(self):
cmdline = f'{self.prefix} s3://bucket/foo {self.files.rootdir} --checksum-mode ENABLED'
self.run_cmd(cmdline, expected_rc=0)
self.assertEqual(self.operations_called[0][0].name, 'ListObjectsV2')
self.assertEqual(self.operations_called[1][0].name, 'GetObject')
self.assertIn(('ChecksumMode', 'ENABLED'), self.operations_called[1][1].items())

def test_download_with_checksum_mode_sha256(self):
self.parsed_responses = [
self.head_object_response(),
self.list_objects_response(['bucket']),
# Mocked GetObject response with an included checksum algorithm specified
{
'ContentLength': '100',
'LastModified': '00:00:00Z',
Expand All @@ -441,6 +445,8 @@ def test_download_with_checksum_mode_sha256(self):
cmdline = f'{self.prefix} s3://bucket/foo {self.files.rootdir} --checksum-mode ENABLED'
self.run_cmd(cmdline, expected_rc=0)
self.assertEqual(self.operations_called[0][0].name, 'ListObjectsV2')
self.assertEqual(self.operations_called[1][0].name, 'GetObject')
self.assertIn(('ChecksumMode', 'ENABLED'), self.operations_called[1][1].items())


class TestSyncSourceRegion(BaseS3CLIRunnerTest):
Expand Down

0 comments on commit 870e739

Please sign in to comment.