Loading searx/engines/wolframalpha_api.py +1 −1 Original line number Diff line number Diff line Loading @@ -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): Loading tests/unit/engines/test_wolframalpha_api.py +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class TestWolframAlphaAPIEngine(SearxTestCase): 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 Loading Loading @@ -83,7 +83,7 @@ class TestWolframAlphaAPIEngine(SearxTestCase): </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) Loading Loading @@ -144,7 +144,7 @@ class TestWolframAlphaAPIEngine(SearxTestCase): </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) Loading Loading
searx/engines/wolframalpha_api.py +1 −1 Original line number Diff line number Diff line Loading @@ -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): Loading
tests/unit/engines/test_wolframalpha_api.py +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class TestWolframAlphaAPIEngine(SearxTestCase): 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 Loading Loading @@ -83,7 +83,7 @@ class TestWolframAlphaAPIEngine(SearxTestCase): </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) Loading Loading @@ -144,7 +144,7 @@ class TestWolframAlphaAPIEngine(SearxTestCase): </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) Loading