ADD xtractmime to pinnedtests

This commit is contained in:
Akshay Sharma 2021-08-09 17:28:12 +05:30
parent 2ba2f49ac5
commit 9980a3d134
3 changed files with 4 additions and 2 deletions

View File

@ -136,7 +136,7 @@ class ResponseTypes:
mimetype, encoding = self.mimetypes.guess_type(filename)
if encoding:
return (f"application/{encoding}".encode(),)
else:
elif mimetype:
return (mimetype.encode(),)
return None

View File

@ -90,6 +90,7 @@ class ResponseTypesTest(unittest.TestCase):
({'filename': 'file.pdf'}, Response),
({'url': 'http://www.example.com/item/file.pdf'}, Response),
({'body': b'Some plain text data\1\2 with tabs and\n null bytes\0'}, Response),
({'filename': '/tmp/temp^'}, TextResponse),
]
for source, cls in mappings:
retcls = responsetypes.from_args(**source)

View File

@ -17,7 +17,7 @@ deps =
#mitmproxy >= 5.3.0; python_version >= '3.9' and implementation_name != 'pypy'
mitmproxy >= 4.0.4; python_version >= '3.7' and python_version < '3.9' and implementation_name != 'pypy'
mitmproxy >= 4.0.4, < 5; python_version >= '3.6' and python_version < '3.7' and platform_system != 'Windows' and implementation_name != 'pypy'
git+https://github.com/scrapy/xtractmime.git@binary#egg=xtractmime
git+https://github.com/scrapy/xtractmime.git@main#egg=xtractmime
# Extras
botocore>=1.4.87
passenv =
@ -79,6 +79,7 @@ deps =
Twisted[http2]==17.9.0
w3lib==1.17.0
zope.interface==4.1.3
git+https://github.com/scrapy/xtractmime.git@main#egg=xtractmime
-rtests/requirements-py3.txt
# mitmproxy 4.0.4+ requires upgrading some of the pinned dependencies