summaryrefslogtreecommitdiff
path: root/searx/tests
diff options
context:
space:
mode:
authora01200356 <a01200356@itesm.mx>2016-01-02 22:29:20 -0600
committera01200356 <a01200356@itesm.mx>2016-01-02 22:29:20 -0600
commitd05c676ed5b1dc5372b1cb380740161b3613f7cc (patch)
tree570970099a74220e81217c37df929835b2703ddd /searx/tests
parent19d025f0e7ef9a5f41b81fc6c1a9a7114bdae78c (diff)
Add test case in wolframalpha_noapi
[fix] Display multiple answers in wolframalpha_api
Diffstat (limited to 'searx/tests')
-rw-r--r--searx/tests/engines/test_wolframalpha_noapi.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/searx/tests/engines/test_wolframalpha_noapi.py b/searx/tests/engines/test_wolframalpha_noapi.py
index 5815e52fe..b2ae5469e 100644
--- a/searx/tests/engines/test_wolframalpha_noapi.py
+++ b/searx/tests/engines/test_wolframalpha_noapi.py
@@ -22,8 +22,27 @@ 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), [])
+ html = """
+ <!DOCTYPE html>
+ <title> Parangaricutirimícuaro - Wolfram|Alpha</title>
+ <meta charset="utf-8" />
+ <body>
+ <div id="closest">
+ <p class="pfail">Wolfram|Alpha doesn't know how to interpret your input.</p>
+ <div id="dtips">
+ <div class="tip">
+ <span class="tip-title">Tip:&nbsp;</span>
+ Check your spelling, and use English
+ <span class="tip-extra"></span>
+ </div>
+ </div>
+ </div>
+ </body>
+ </html>
+ """
+
+ response = mock.Mock(text=html)
+ self.assertEqual(wolframalpha_noapi.response(response), [])
html = """
<!DOCTYPE html>