Exemplo n.º 1
0
 def test_body_or_str(self):
     for obj in (self.bbody, self.ubody, self.txtresponse, self.response):
         r1 = _body_or_str(obj)
         self._assert_type_and_value(r1, self.ubody, obj)
         r2 = _body_or_str(obj, unicode=True)
         self._assert_type_and_value(r2, self.ubody, obj)
         r3 = _body_or_str(obj, unicode=False)
         self._assert_type_and_value(r3, self.bbody, obj)
         self.assertTrue(type(r1) is type(r2))
         self.assertTrue(type(r1) is not type(r3))
Exemplo n.º 2
0
 def test_body_or_str(self):
     for obj in (self.bbody, self.ubody, self.txtresponse, self.response):
         r1 = _body_or_str(obj)
         self._assert_type_and_value(r1, self.ubody, obj)
         r2 = _body_or_str(obj, unicode=True)
         self._assert_type_and_value(r2, self.ubody, obj)
         r3 = _body_or_str(obj, unicode=False)
         self._assert_type_and_value(r3, self.bbody, obj)
         self.assertTrue(type(r1) is type(r2))
         self.assertTrue(type(r1) is not type(r3))
Exemplo n.º 3
0
def body_or_str(*a, **kw):
    from scrapy.utils.iterators import _body_or_str
    return _body_or_str(*a, **kw)
Exemplo n.º 4
0
def body_or_str(*a, **kw):
    from scrapy.utils.iterators import _body_or_str
    return _body_or_str(*a, **kw)