From daabc718a9e63556b5aa9ae7e92bb0fc4cb7604f Mon Sep 17 00:00:00 2001 From: Nikolaos-Digenis Karagiannis Date: Wed, 2 Jul 2014 16:03:21 +0300 Subject: [PATCH] selector.__repr__ test --- scrapy/tests/test_selector.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scrapy/tests/test_selector.py b/scrapy/tests/test_selector.py index d60521cbc..00790537b 100644 --- a/scrapy/tests/test_selector.py +++ b/scrapy/tests/test_selector.py @@ -36,6 +36,16 @@ class SelectorTestCase(unittest.TestCase): self.assertEqual([x.extract() for x in sel.xpath("concat(//input[@name='a']/@value, //input[@name='b']/@value)")], [u'12']) + def test_representation(self): + body = u"

".format(50 * 'b') + response = TextResponse(url="http://example.com", body=body, encoding='utf8') + sel = self.sscls(response) + + self.assertEqual( + map(repr, sel.xpath('//input/@name')), + [u"".format(40 * 'b')] + ) + def test_select_unicode_query(self): body = u"

" response = TextResponse(url="http://example.com", body=body, encoding='utf8')