Skip to content

Commit

Permalink
Add integ tests for aws#718
Browse files Browse the repository at this point in the history
The root cause was in botocore which has its own tests, but
this verifies that we can upload/download/sync files with spaces
as expected.  Depends on boto/botocore#264.
  • Loading branch information
jamesls committed Mar 27, 2014
1 parent 0a97f59 commit 85ab435
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/integration/customizations/s3/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,32 @@ def test_s3_filtering(self):

class TestFileWithSpaces(BaseS3CLICommand):
def test_upload_download_file_with_spaces(self):
pass
bucket_name = self.create_bucket()
filename = self.files.create_file('with space.txt', 'contents')
p = aws('s3 cp %s s3://%s/ --recursive' % (self.files.rootdir,
bucket_name))
self.assert_no_errors(p)
os.remove(filename)
# Now download the file back down locally.
p = aws('s3 cp s3://%s/ %s --recursive' % (bucket_name,
self.files.rootdir))
self.assert_no_errors(p)
self.assertEqual(os.listdir(self.files.rootdir)[0], 'with space.txt')

def test_sync_file_with_spaces(self):
bucket_name = self.create_bucket()
bucket_name = self.create_bucket()
filename = self.files.create_file('with space.txt', 'contents')
p = aws('s3 sync %s s3://%s/' % (self.files.rootdir,
bucket_name))
self.assert_no_errors(p)
# Now syncing again should *not* trigger any uploads (i.e we should
# get nothing on stdout).
p2 = aws('s3 sync %s s3://%s/' % (self.files.rootdir,
bucket_name))
self.assertEqual(p2.stdout, '')
self.assertEqual(p2.stderr, '')
self.assertEqual(p2.rc, 0)


if __name__ == "__main__":
Expand Down

0 comments on commit 85ab435

Please sign in to comment.