Skip to content

Commit

Permalink
Add test for us-gov-west-1 and virtual style
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleknap committed Oct 13, 2015
1 parent 4c04307 commit 1cf7775
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/functional/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ def test_provided_endpoint_url_for_virtual_addressing(self):
self.assertEqual(
'https://mybucket.foo.amazonaws.com/mykey', request_sent.url)

def test_us_gov_with_virtual_addressing(self):
s3 = self.session.create_client(
's3', region_name='us-gov-west-1',
config=Config(s3={'addressing_style': 'virtual'}))
with mock.patch('botocore.endpoint.Session.send') \
as mock_send:
mock_send.return_value = self.http_response
s3.put_object(Bucket='mybucket', Key='mykey', Body='mybody')
request_sent = mock_send.call_args[0][0]
self.assertEqual(
'https://mybucket.s3-us-gov-west-1.amazonaws.com/mykey',
request_sent.url)


class TestPathHostStyle(BaseS3AddressingStyle):
def test_default_endpoint_for_path_addressing(self):
Expand Down

0 comments on commit 1cf7775

Please sign in to comment.