From b034356825420507c9fb7ee2dc100676a88cf6c7 Mon Sep 17 00:00:00 2001 From: Noémi Ványi Date: Sun, 11 Dec 2016 16:41:14 +0100 Subject: add year filter to engines with time range support && tests Following engines does not support "Last year": * Bing News * DeviantArt * DuckDuckGo * Yahoo * YouTube (noapi) --- tests/unit/engines/test_yahoo.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/unit/engines/test_yahoo.py') diff --git a/tests/unit/engines/test_yahoo.py b/tests/unit/engines/test_yahoo.py index 1226f92ab..303295e2f 100644 --- a/tests/unit/engines/test_yahoo.py +++ b/tests/unit/engines/test_yahoo.py @@ -46,6 +46,13 @@ class TestYahooEngine(SearxTestCase): self.assertIn('en', params['cookies']['sB']) self.assertIn('en', params['url']) + def test_no_url_in_request_year_time_range(self): + dicto = defaultdict(dict) + query = 'test_query' + dicto['time_range'] = 'year' + params = yahoo.request(query, dicto) + self.assertEqual({}, params['url']) + def test_response(self): self.assertRaises(AttributeError, yahoo.response, None) self.assertRaises(AttributeError, yahoo.response, []) -- cgit v1.2.3-54-g00ecf