mirror of https://github.com/scrapy/scrapy.git
add a check that byte url is not accepted in http.Response on py3
This commit is contained in:
parent
99f1f2ad1d
commit
96fcf4cea4
|
|
@ -17,6 +17,8 @@ class BaseResponseTest(unittest.TestCase):
|
|||
# Response requires url in the consturctor
|
||||
self.assertRaises(Exception, self.response_class)
|
||||
self.assertTrue(isinstance(self.response_class('http://example.com/'), self.response_class))
|
||||
if not six.PY2:
|
||||
self.assertRaises(TypeError, self.response_class, b"http://example.com")
|
||||
# body can be str or None
|
||||
self.assertTrue(isinstance(self.response_class('http://example.com/', body=b''), self.response_class))
|
||||
self.assertTrue(isinstance(self.response_class('http://example.com/', body=b'body'), self.response_class))
|
||||
|
|
|
|||
Loading…
Reference in New Issue