summaryrefslogtreecommitdiff
path: root/searx/tests/engines/test_wolframalpha_noapi.py
diff options
context:
space:
mode:
authora01200356 <a01200356@itesm.mx>2016-01-02 00:41:14 -0600
committera01200356 <a01200356@itesm.mx>2016-01-02 00:41:14 -0600
commite9d35c1309f05a0b214fb323049909ee7ec62ab8 (patch)
treec9b8cf6cdb951b66c86c9c55c328456e59cb4042 /searx/tests/engines/test_wolframalpha_noapi.py
parent0871c7ca85cd19a2fa0971c7db28516a74255d5d (diff)
update tests for wolframalpha
Diffstat (limited to 'searx/tests/engines/test_wolframalpha_noapi.py')
-rw-r--r--searx/tests/engines/test_wolframalpha_noapi.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/searx/tests/engines/test_wolframalpha_noapi.py b/searx/tests/engines/test_wolframalpha_noapi.py
index d02dccd95..b884ffa38 100644
--- a/searx/tests/engines/test_wolframalpha_noapi.py
+++ b/searx/tests/engines/test_wolframalpha_noapi.py
@@ -22,8 +22,8 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
self.assertRaises(AttributeError, wolframalpha_noapi.response, '')
self.assertRaises(AttributeError, wolframalpha_noapi.response, '[]')
- response = mock.Mock(text='<html></html>')
- self.assertEqual(wolframalpha_noapi.response(response), [])
+ # response = mock.Mock(text='<html></html>')
+ # self.assertEqual(wolframalpha_noapi.response(response), [])
html = """
<!DOCTYPE html>
@@ -135,8 +135,10 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
response = mock.Mock(text=html)
results = wolframalpha_noapi.response(response)
self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
+ self.assertEqual(len(results), 2)
self.assertIn("i", results[0]['answer'])
+ self.assertIn("sqrt(-1) - Wolfram|Alpha", results[1]['title'])
+ self.assertIn("http://www.wolframalpha.com/input/?i=sqrt%28-1%29", results[1]['url'])
html = """
<!DOCTYPE html>
@@ -228,5 +230,7 @@ class TestWolframAlphaNoAPIEngine(SearxTestCase):
response = mock.Mock(text=html)
results = wolframalpha_noapi.response(response)
self.assertEqual(type(results), list)
- self.assertEqual(len(results), 1)
+ self.assertEqual(len(results), 2)
self.assertIn("log(x)+c", results[0]['answer'])
+ self.assertIn("integral 1/x - Wolfram|Alpha", results[1]['title'])
+ self.assertIn("http://www.wolframalpha.com/input/?i=integral+1%2Fx", results[1]['url'])