|
@@ -21,10 +21,10 @@ class TestBaseEngine(SearxTestCase):
|
21
|
21
|
self.assertRaises(AttributeError, base.response, '')
|
22
|
22
|
self.assertRaises(AttributeError, base.response, '[]')
|
23
|
23
|
|
24
|
|
- response = mock.Mock(text='<response></response>')
|
|
24
|
+ response = mock.Mock(content=b'<response></response>')
|
25
|
25
|
self.assertEqual(base.response(response), [])
|
26
|
26
|
|
27
|
|
- xml_mock = """<?xml version="1.0"?>
|
|
27
|
+ xml_mock = b"""<?xml version="1.0"?>
|
28
|
28
|
<response>
|
29
|
29
|
<lst name="responseHeader">
|
30
|
30
|
<int name="status">0</int>
|
|
@@ -83,7 +83,7 @@ class TestBaseEngine(SearxTestCase):
|
83
|
83
|
</result>
|
84
|
84
|
</response>"""
|
85
|
85
|
|
86
|
|
- response = mock.Mock(text=xml_mock.encode('utf-8'))
|
|
86
|
+ response = mock.Mock(content=xml_mock)
|
87
|
87
|
results = base.response(response)
|
88
|
88
|
self.assertEqual(type(results), list)
|
89
|
89
|
self.assertEqual(len(results), 1)
|