mirror of
https://github.com/searxng/searxng.git
synced 2025-12-23 12:10:00 +00:00
@@ -21,11 +21,11 @@ class TestBaseEngine(SearxTestCase):
|
||||
self.assertRaises(AttributeError, arxiv.response, '')
|
||||
self.assertRaises(AttributeError, arxiv.response, '[]')
|
||||
|
||||
response = mock.Mock(text='''<?xml version="1.0" encoding="UTF-8"?>
|
||||
response = mock.Mock(content=b'''<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom"></feed>''')
|
||||
self.assertEqual(arxiv.response(response), [])
|
||||
|
||||
xml_mock = '''<?xml version="1.0" encoding="UTF-8"?>
|
||||
xml_mock = b'''<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
<title type="html">ArXiv Query: search_query=all:test_query&id_list=&start=0&max_results=1</title>
|
||||
<id>http://arxiv.org/api/1</id>
|
||||
@@ -50,7 +50,7 @@ class TestBaseEngine(SearxTestCase):
|
||||
</feed>
|
||||
'''
|
||||
|
||||
response = mock.Mock(text=xml_mock.encode('utf-8'))
|
||||
response = mock.Mock(content=xml_mock)
|
||||
results = arxiv.response(response)
|
||||
self.assertEqual(type(results), list)
|
||||
self.assertEqual(len(results), 1)
|
||||
|
||||
Reference in New Issue
Block a user