Skip to content

Commit

Permalink
Add failing quoted string test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lee Trout committed Mar 4, 2014
1 parent 28e34e1 commit 30ad389
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/unit/auth/test_sigv4.py
Expand Up @@ -54,15 +54,18 @@ def test_inner_whitespace_is_collapsed(self):
auth = HmacAuthV4Handler('glacier.us-east-1.amazonaws.com',
Mock(), self.provider)
self.request.headers['x-amz-archive-description'] = 'two spaces'
self.request.headers['x-amz-quoted-string'] = ' "a b c" '
headers = auth.headers_to_sign(self.request)
self.assertEqual(headers, {'Host': 'glacier.us-east-1.amazonaws.com',
'x-amz-archive-description': 'two spaces',
'x-amz-glacier-version': '2012-06-01'})
'x-amz-glacier-version': '2012-06-01',
'x-amz-quoted-string': ' "a b c" '})
# Note the single space between the "two spaces".
self.assertEqual(auth.canonical_headers(headers),
'host:glacier.us-east-1.amazonaws.com\n'
'x-amz-archive-description:two spaces\n'
'x-amz-glacier-version:2012-06-01')
'x-amz-glacier-version:2012-06-01\n'
'x-amz-quoted-string:"a b c"')

def test_canonical_query_string(self):
auth = HmacAuthV4Handler('glacier.us-east-1.amazonaws.com',
Expand Down

0 comments on commit 30ad389

Please sign in to comment.