mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
add year filter to engines with time range support && tests
Following engines does not support "Last year": * Bing News * DeviantArt * DuckDuckGo * Yahoo * YouTube (noapi)
This commit is contained in:
parent
c59c76e6ee
commit
b034356825
9 changed files with 43 additions and 2 deletions
|
@ -19,6 +19,13 @@ class TestDuckduckgoEngine(SearxTestCase):
|
|||
self.assertIn('duckduckgo.com', params['url'])
|
||||
self.assertIn('ch-de', params['url'])
|
||||
|
||||
def test_no_url_in_request_year_time_range(self):
|
||||
dicto = defaultdict(dict)
|
||||
query = 'test_query'
|
||||
dicto['time_range'] = 'year'
|
||||
params = duckduckgo.request(query, dicto)
|
||||
self.assertEqual({}, params['url'])
|
||||
|
||||
def test_response(self):
|
||||
self.assertRaises(AttributeError, duckduckgo.response, None)
|
||||
self.assertRaises(AttributeError, duckduckgo.response, [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue