From e9d35c1309f05a0b214fb323049909ee7ec62ab8 Mon Sep 17 00:00:00 2001 From: a01200356 Date: Sat, 2 Jan 2016 00:41:14 -0600 Subject: update tests for wolframalpha --- searx/tests/engines/test_wolframalpha_noapi.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'searx/tests/engines/test_wolframalpha_noapi.py') 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='') - self.assertEqual(wolframalpha_noapi.response(response), []) + # response = mock.Mock(text='') + # self.assertEqual(wolframalpha_noapi.response(response), []) 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 = """ @@ -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']) -- cgit v1.2.3