From d6bea3bf2eb4793555366a3341fe41456704b860 Mon Sep 17 00:00:00 2001 From: Konstantin Lopuhin Date: Fri, 5 Feb 2016 15:17:59 +0300 Subject: [PATCH] botocore not only does not allow passing our own Date header, but does not handle x-amz-date according to the spec --- tests/test_downloader_handlers.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/test_downloader_handlers.py b/tests/test_downloader_handlers.py index 6c4d2e0db..57225ee3d 100644 --- a/tests/test_downloader_handlers.py +++ b/tests/test_downloader_handlers.py @@ -546,6 +546,11 @@ class S3TestCase(BaseS3TestCase): b'AWS 0PN5J17HBGZHT7JJ3X82:thdUi9VAkzhkniLj96JIrOPGi0g=') def test_request_signing5(self): + try: import botocore + except ImportError: pass + else: + raise unittest.SkipTest( + 'botocore does not support overriding date with x-amz-date') # deletes an object from the 'johnsmith' bucket using the # path-style and Date alternative. date = 'Tue, 27 Mar 2007 21:20:27 +0000' @@ -557,9 +562,8 @@ class S3TestCase(BaseS3TestCase): with self._mocked_date(date): httpreq = self.download_request(req, self.spider) # botocore does not override Date with x-amz-date - self.assertIn(httpreq.headers['Authorization'], [ - b'AWS 0PN5J17HBGZHT7JJ3X82:k3nL7gH3+PadhTEVn5Ip83xlYzk=', - b'AWS 0PN5J17HBGZHT7JJ3X82:otYM2krxnuHhAofO4oqIV7wcfdU=']) + self.assertEqual(httpreq.headers['Authorization'], + b'AWS 0PN5J17HBGZHT7JJ3X82:k3nL7gH3+PadhTEVn5Ip83xlYzk=') def test_request_signing6(self): # uploads an object to a CNAME style virtual hosted bucket with metadata.