mirror of https://github.com/scrapy/scrapy.git
check that no extra kwargs are silently discarded
This commit is contained in:
parent
d6bea3bf2e
commit
bcb92b50dc
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Reference in New Issue