From 0607b167f85acc6c0ab4c641f14b53cb4190e445 Mon Sep 17 00:00:00 2001 From: misnyo Date: Wed, 30 Aug 2017 18:53:00 +0200 Subject: [fix] faroo json api and image layout fixed --- tests/unit/engines/test_faroo.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/unit/engines/test_faroo.py b/tests/unit/engines/test_faroo.py index acebdda86..ebcde39a7 100644 --- a/tests/unit/engines/test_faroo.py +++ b/tests/unit/engines/test_faroo.py @@ -40,9 +40,6 @@ class TestFarooEngine(SearxTestCase): response = mock.Mock(text='{"data": []}') self.assertEqual(faroo.response(response), []) - response = mock.Mock(text='{"data": []}', status_code=401) - self.assertRaises(Exception, faroo.response, response) - response = mock.Mock(text='{"data": []}', status_code=429) self.assertRaises(Exception, faroo.response, response) @@ -98,14 +95,14 @@ class TestFarooEngine(SearxTestCase): response = mock.Mock(text=json) results = faroo.response(response) self.assertEqual(type(results), list) - self.assertEqual(len(results), 4) + self.assertEqual(len(results), 3) self.assertEqual(results[0]['title'], 'This is the title') self.assertEqual(results[0]['url'], 'http://this.is.the.url/') self.assertEqual(results[0]['content'], 'This is the content') self.assertEqual(results[1]['title'], 'This is the title2') self.assertEqual(results[1]['url'], 'http://this.is.the.url2/') self.assertEqual(results[1]['content'], 'This is the content2') - self.assertEqual(results[3]['img_src'], 'http://upload.wikimedia.org/optimized.jpg') + self.assertEqual(results[2]['thumbnail'], 'http://upload.wikimedia.org/optimized.jpg') json = """ {} -- cgit v1.2.3-54-g00ecf