|
@@ -31,10 +31,10 @@ class TestBingImagesEngine(SearxTestCase):
|
31
|
31
|
self.assertRaises(AttributeError, bing_images.response, '')
|
32
|
32
|
self.assertRaises(AttributeError, bing_images.response, '[]')
|
33
|
33
|
|
34
|
|
- response = mock.Mock(content='<html></html>')
|
|
34
|
+ response = mock.Mock(text='<html></html>')
|
35
|
35
|
self.assertEqual(bing_images.response(response), [])
|
36
|
36
|
|
37
|
|
- response = mock.Mock(content='<html></html>')
|
|
37
|
+ response = mock.Mock(text='<html></html>')
|
38
|
38
|
self.assertEqual(bing_images.response(response), [])
|
39
|
39
|
|
40
|
40
|
html = """
|
|
@@ -52,7 +52,7 @@ oh:"238",tft:"0",oi:"http://www.image.url/Images/Test%2
|
52
|
52
|
</div>
|
53
|
53
|
"""
|
54
|
54
|
html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
|
55
|
|
- response = mock.Mock(content=html)
|
|
55
|
+ response = mock.Mock(text=html)
|
56
|
56
|
results = bing_images.response(response)
|
57
|
57
|
self.assertEqual(type(results), list)
|
58
|
58
|
self.assertEqual(len(results), 1)
|
|
@@ -75,7 +75,7 @@ oh:"238",tft:"0",oi:"http://www.image.url/Images/Test%2
|
75
|
75
|
style="height:144px;" width="178" height="144"/>
|
76
|
76
|
</a>
|
77
|
77
|
"""
|
78
|
|
- response = mock.Mock(content=html)
|
|
78
|
+ response = mock.Mock(text=html)
|
79
|
79
|
results = bing_images.response(response)
|
80
|
80
|
self.assertEqual(type(results), list)
|
81
|
81
|
self.assertEqual(len(results), 0)
|
|
@@ -263,7 +263,7 @@ oh:"238",tft:"0",oi:"http://www.image.url/Images/Test%2
|
263
|
263
|
</div>
|
264
|
264
|
"""
|
265
|
265
|
html = html.replace('\r\n', '').replace('\n', '').replace('\r', '')
|
266
|
|
- response = mock.Mock(content=html)
|
|
266
|
+ response = mock.Mock(text=html)
|
267
|
267
|
results = bing_images.response(response)
|
268
|
268
|
self.assertEqual(type(results), list)
|
269
|
269
|
self.assertEqual(len(results), 10)
|