on master help sign in
[fix] bing news test mock
commit5da78f7b37b60a6e100e245de99a0ba45be49f01 authorAdam Tauber <asciimoo@gmail.com> dateFri 16 Oct 2015, 12:01 (11 years ago) parent7aa9f48
1 file changed+6−6
searx/tests/engines/test_bing_news.py+6−6
searx/tests/engines/test_bing_news.py+6−6
@@ -28,10 +28,10 @@ class TestBingNewsEngine(SearxTestCase):
2828 self.assertRaises(AttributeError, bing_news.response, '')
2929 self.assertRaises(AttributeError, bing_news.response, '[]')
3030
31− response = mock.Mock(text='<html></html>')
31+ response = mock.Mock(content='<html></html>')
3232 self.assertEqual(bing_news.response(response), [])
3333
34− response = mock.Mock(text='<html></html>')
34+ response = mock.Mock(content='<html></html>')
3535 self.assertEqual(bing_news.response(response), [])
3636
3737 html = """<?xml version="1.0" encoding="utf-8" ?>
@@ -66,7 +66,7 @@ class TestBingNewsEngine(SearxTestCase):
6666 </item>
6767 </channel>
6868</rss>""" # noqa
69− response = mock.Mock(text=html)
69+ response = mock.Mock(content=html)
7070 results = bing_news.response(response)
7171 self.assertEqual(type(results), list)
7272 self.assertEqual(len(results), 2)
@@ -105,7 +105,7 @@ class TestBingNewsEngine(SearxTestCase):
105105 </item>
106106 </channel>
107107</rss>""" # noqa
108− response = mock.Mock(text=html)
108+ response = mock.Mock(content=html)
109109 results = bing_news.response(response)
110110 self.assertEqual(type(results), list)
111111 self.assertEqual(len(results), 1)
@@ -128,11 +128,11 @@ class TestBingNewsEngine(SearxTestCase):
128128 </channel>
129129</rss>""" # noqa
130130
131− response = mock.Mock(text=html)
131+ response = mock.Mock(content=html)
132132 results = bing_news.response(response)
133133 self.assertEqual(type(results), list)
134134 self.assertEqual(len(results), 0)
135135
136136 html = """<?xml version="1.0" encoding="utf-8" ?>gabarge"""
137− response = mock.Mock(text=html)
137+ response = mock.Mock(content=html)
138138 self.assertRaises(lxml.etree.XMLSyntaxError, bing_news.response, response)