def test_signature(self): expected = b("26NBxoKdsyly4EDv6inkoDft/yA=") headers = { "Content-MD5": "ODBGOERFMDMzQTczRUY3NUE3NzA5QzdFNUYzMDQxNEM=", "Content-Type": "text/html", "Expires": "Thu, 17 Nov 2005 18:49:58 GMT", "X-OSS-Meta-Author": "*****@*****.**", "X-OSS-Magic": "abracadabra", "Host": "oss-example.oss-cn-hangzhou.aliyuncs.com", } action = "/oss-example/nelson" actual = OSSConnection._get_auth_signature( "PUT", headers, {}, headers["Expires"], self.conn.key, action, "x-oss-" ) self.assertEqual(expected, actual)
def test_signature(self): expected = b('26NBxoKdsyly4EDv6inkoDft/yA=') headers = { 'Content-MD5': 'ODBGOERFMDMzQTczRUY3NUE3NzA5QzdFNUYzMDQxNEM=', 'Content-Type': 'text/html', 'Expires': 'Thu, 17 Nov 2005 18:49:58 GMT', 'X-OSS-Meta-Author': '*****@*****.**', 'X-OSS-Magic': 'abracadabra', 'Host': 'oss-example.oss-cn-hangzhou.aliyuncs.com' } action = '/oss-example/nelson' actual = OSSConnection._get_auth_signature('PUT', headers, {}, headers['Expires'], self.conn.key, action, 'x-oss-') self.assertEqual(expected, actual)
def setUp(self): self.conn = OSSConnection('44CF9590006BF252F707', 'OtxrzxIsfpFjA7SwPzILwy8Bw21TLhquhboDYROV')