mirror of https://github.com/scrapy/scrapy.git
Add tests for meta and cb_kwargs not being available
This commit is contained in:
parent
5ff9eb90ea
commit
43b43654a1
|
|
@ -78,6 +78,16 @@ class BaseResponseTest(unittest.TestCase):
|
|||
r1 = self.response_class("http://www.example.com", body=b"Some body", request=req)
|
||||
assert r1.cb_kwargs is req.cb_kwargs
|
||||
|
||||
def test_unavailable_meta(self):
|
||||
r1 = self.response_class("http://www.example.com", body=b"Some body")
|
||||
with self.assertRaisesRegex(AttributeError, r'Response\.meta not available'):
|
||||
r1.meta
|
||||
|
||||
def test_unavailable_cb_kwargs(self):
|
||||
r1 = self.response_class("http://www.example.com", body=b"Some body")
|
||||
with self.assertRaisesRegex(AttributeError, r'Response\.cb_kwargs not available'):
|
||||
r1.cb_kwargs
|
||||
|
||||
def test_copy_inherited_classes(self):
|
||||
"""Test Response children copies preserve their class"""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue