diff options
| author | Tim Burke <tim.burke@gmail.com> | 2022-07-22 21:38:57 -0700 |
|---|---|---|
| committer | Tim Burke <tim.burke@gmail.com> | 2022-08-29 13:13:34 -0700 |
| commit | f4e62191bc174e6235130aab36feb3b161de7848 (patch) | |
| tree | 3103b0c5ba3a7a1567f8c11a1cfb6dc5e472abff /test/unit | |
| parent | 662e530d8d4e8e74ba087733f1f51cb98d5145cc (diff) | |
| download | python-swiftclient-f4e62191bc174e6235130aab36feb3b161de7848.tar.gz | |
Allow tempurl to be used to sign /info requests
Change-Id: I1f9d26541e9c8f5aec7a6790c87df397d178efe6
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/test_utils.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_utils.py b/test/unit/test_utils.py index 6d2f4a1..deb3857 100644 --- a/test/unit/test_utils.py +++ b/test/unit/test_utils.py @@ -508,6 +508,32 @@ class TestTempURLBytesPathAndNonUtf8Key(TestTempURL): ]) +class TestTempURLInfoPath(TestTempURL): + url = '/info'.encode('utf-8') + expected_body = b'\n'.join([ + b'GET', + b'1400003600', + url, + ]) + + @property + def expected_url(self): + if isinstance(self.url, bytes): + return self.url + (b'?swiftinfo_sig=temp_url_signature' + b'&swiftinfo_expires=1400003600') + return self.url + (u'?swiftinfo_sig=temp_url_signature' + u'&swiftinfo_expires=1400003600') + + @property + def expected_sha512_url(self): + if isinstance(self.url, bytes): + return self.url + ( + b'?swiftinfo_sig=sha512:dGVtcF91cmxfc2lnbmF0dXJl' + b'&swiftinfo_expires=1400003600') + return self.url + (u'?swiftinfo_sig=sha512:dGVtcF91cmxfc2lnbmF0dXJl' + u'&swiftinfo_expires=1400003600') + + class TestReadableToIterable(unittest.TestCase): def test_iter(self): |
