本文整理汇总了Python中txaws.ec2.client.Query.params["Signature"]方法的典型用法代码示例。如果您正苦于以下问题:Python Query.params["Signature"]方法的具体用法?Python Query.params["Signature"]怎么用?Python Query.params["Signature"]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类txaws.ec2.client.Query
的用法示例。
在下文中一共展示了Query.params["Signature"]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_handle_with_wrong_signature
# 需要导入模块: from txaws.ec2.client import Query [as 别名]
# 或者: from txaws.ec2.client.Query import params["Signature"] [as 别名]
def test_handle_with_wrong_signature(self):
"""
If the signature in the request doesn't match the one calculated with
the locally stored secret access key, and error is returned.
"""
creds = AWSCredentials("access", "secret")
endpoint = AWSServiceEndpoint("http://uri")
query = Query(action="SomeAction", creds=creds, endpoint=endpoint)
query.sign()
query.params["Signature"] = "wrong"
request = FakeRequest(query.params, endpoint)
def check(ignored):
self.flushLoggedErrors()
self.assertEqual("SignatureDoesNotMatch - The request signature "
"we calculated does not match the signature you "
"provided. Check your key and signing method.",
request.response)
self.assertEqual(403, request.code)
self.api.principal = TestPrincipal(creds)
return self.api.handle(request).addCallback(check)