[fix] bing unicode encode error - fixes #408

This commit is contained in:
Adam Tauber 2015-08-28 14:51:32 +02:00
parent b9c8039d74
commit 604f32f672
6 changed files with 18 additions and 18 deletions

View file

@ -29,10 +29,10 @@ class TestBingEngine(SearxTestCase):
self.assertRaises(AttributeError, bing.response, '')
self.assertRaises(AttributeError, bing.response, '[]')
response = mock.Mock(content='<html></html>')
response = mock.Mock(text='<html></html>')
self.assertEqual(bing.response(response), [])
response = mock.Mock(content='<html></html>')
response = mock.Mock(text='<html></html>')
self.assertEqual(bing.response(response), [])
html = """
@ -54,7 +54,7 @@ class TestBingEngine(SearxTestCase):
</div>
</div>
"""
response = mock.Mock(content=html)
response = mock.Mock(text=html)
results = bing.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)
@ -81,7 +81,7 @@ class TestBingEngine(SearxTestCase):
</div>
</li>
"""
response = mock.Mock(content=html)
response = mock.Mock(text=html)
results = bing.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)