From 3f13b388c711da1a1d41cc3add763ffbe613e65d Mon Sep 17 00:00:00 2001 From: Pablo Hoffman Date: Sun, 18 Jan 2009 19:31:35 +0000 Subject: [PATCH] added additional test to ResponseSoup extension --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40747 --- scrapy/trunk/scrapy/tests/test_contrib_response_soup.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scrapy/trunk/scrapy/tests/test_contrib_response_soup.py b/scrapy/trunk/scrapy/tests/test_contrib_response_soup.py index 82c291038..c07b26873 100644 --- a/scrapy/trunk/scrapy/tests/test_contrib_response_soup.py +++ b/scrapy/trunk/scrapy/tests/test_contrib_response_soup.py @@ -21,6 +21,11 @@ class ResponseSoupTest(unittest.TestCase): # make sure it's cached assert soup1 is soup2 + # when body is None, an empty soup should be returned + r1 = Response('http://www.example.com') + assert r1.body is None + assert isinstance(r1.getsoup(), BeautifulSoup) + def test_response_soup_caching(self): r1 = Response('http://www.example.com', body='') soup1 = r1.getsoup()