From 30ad389eaae59d0aaacb3a8defc0783ee2fa783c Mon Sep 17 00:00:00 2001 From: Lee Trout Date: Tue, 4 Mar 2014 11:15:05 -0500 Subject: [PATCH] Add failing quoted string test --- tests/unit/auth/test_sigv4.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/auth/test_sigv4.py b/tests/unit/auth/test_sigv4.py index a7fb0a30fe..050f56f231 100644 --- a/tests/unit/auth/test_sigv4.py +++ b/tests/unit/auth/test_sigv4.py @@ -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',