Permalink
Browse files

Merge branch 'master' into engines/unsplash

  • Loading branch information...
d-tux committed Jan 14, 2019
2 parents 329172f + 383e3cc commit f1814079f0da111c27e795e023f5e1ab644c94a0
Showing with 4 additions and 4 deletions.
  1. +1 −1 searx/engines/wolframalpha_api.py
  2. +3 −3 tests/unit/engines/test_wolframalpha_api.py
@@ -65,7 +65,7 @@ def replace_pua_chars(text):
def response(resp):
results = []

search_results = etree.XML(resp.text)
search_results = etree.XML(resp.content)

# return empty array if there are no results
if search_results.xpath(failure_xpath):
@@ -35,7 +35,7 @@ def test_response(self):
xml = '''<?xml version='1.0' encoding='UTF-8'?>
<queryresult success='false' error='false' />
'''
response = mock.Mock(text=xml.encode('utf-8'))
response = mock.Mock(content=xml.encode('utf-8'))
self.assertEqual(wolframalpha_api.response(response), [])

# test basic case
@@ -83,7 +83,7 @@ def test_response(self):
</pod>
</queryresult>
"""
response = mock.Mock(text=xml, request=request)
response = mock.Mock(content=xml, request=request)
results = wolframalpha_api.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 2)
@@ -144,7 +144,7 @@ def test_response(self):
</pod>
</queryresult>
"""
response = mock.Mock(text=xml, request=request)
response = mock.Mock(content=xml, request=request)
results = wolframalpha_api.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 2)

0 comments on commit f181407

Please sign in to comment.