Browse Source

[fix] bing news test mock

Adam Tauber 9 years ago
parent
commit
5da78f7b37
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      searx/tests/engines/test_bing_news.py

+ 6
- 6
searx/tests/engines/test_bing_news.py View File

@@ -28,10 +28,10 @@ class TestBingNewsEngine(SearxTestCase):
28 28
         self.assertRaises(AttributeError, bing_news.response, '')
29 29
         self.assertRaises(AttributeError, bing_news.response, '[]')
30 30
 
31
-        response = mock.Mock(text='<html></html>')
31
+        response = mock.Mock(content='<html></html>')
32 32
         self.assertEqual(bing_news.response(response), [])
33 33
 
34
-        response = mock.Mock(text='<html></html>')
34
+        response = mock.Mock(content='<html></html>')
35 35
         self.assertEqual(bing_news.response(response), [])
36 36
 
37 37
         html = """<?xml version="1.0" encoding="utf-8" ?>
@@ -66,7 +66,7 @@ class TestBingNewsEngine(SearxTestCase):
66 66
         </item>
67 67
     </channel>
68 68
 </rss>"""  # noqa
69
-        response = mock.Mock(text=html)
69
+        response = mock.Mock(content=html)
70 70
         results = bing_news.response(response)
71 71
         self.assertEqual(type(results), list)
72 72
         self.assertEqual(len(results), 2)
@@ -105,7 +105,7 @@ class TestBingNewsEngine(SearxTestCase):
105 105
         </item>
106 106
     </channel>
107 107
 </rss>"""  # noqa
108
-        response = mock.Mock(text=html)
108
+        response = mock.Mock(content=html)
109 109
         results = bing_news.response(response)
110 110
         self.assertEqual(type(results), list)
111 111
         self.assertEqual(len(results), 1)
@@ -128,11 +128,11 @@ class TestBingNewsEngine(SearxTestCase):
128 128
     </channel>
129 129
 </rss>"""  # noqa
130 130
 
131
-        response = mock.Mock(text=html)
131
+        response = mock.Mock(content=html)
132 132
         results = bing_news.response(response)
133 133
         self.assertEqual(type(results), list)
134 134
         self.assertEqual(len(results), 0)
135 135
 
136 136
         html = """<?xml version="1.0" encoding="utf-8" ?>gabarge"""
137
-        response = mock.Mock(text=html)
137
+        response = mock.Mock(content=html)
138 138
         self.assertRaises(lxml.etree.XMLSyntaxError, bing_news.response, response)