提交 bcb92b50 编写于 作者: K Konstantin Lopuhin

check that no extra kwargs are silently discarded

上级 d6bea3bf
......@@ -68,6 +68,9 @@ class S3DownloadHandler(object):
except Exception as ex:
raise NotConfigured(str(ex))
else:
kw.pop('anon', None)
if kw:
raise TypeError('Unexpected keyword arguments: %s' % kw)
if not self.anon:
SignerCls = botocore.auth.AUTH_TYPE_MAPS['s3']
self._signer = SignerCls(botocore.credentials.Credentials(
......
......@@ -500,6 +500,10 @@ class S3TestCase(BaseS3TestCase):
mock_formatdate.return_value = date
yield
def test_extra_kw(self):
with self.assertRaises(TypeError):
S3DownloadHandler(Settings(), extra_kw=True)
def test_request_signing1(self):
# gets an object from the johnsmith bucket.
date ='Tue, 27 Mar 2007 19:36:42 +0000'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册