mirror of
https://github.com/searxng/searxng.git
synced 2025-09-10 20:28:25 +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
|
@ -7,8 +7,8 @@ from searx.testing import SearxTestCase
|
|||
class TestDeviantartEngine(SearxTestCase):
|
||||
|
||||
def test_request(self):
|
||||
query = 'test_query'
|
||||
dicto = defaultdict(dict)
|
||||
query = 'test_query'
|
||||
dicto['pageno'] = 0
|
||||
dicto['time_range'] = ''
|
||||
params = deviantart.request(query, dicto)
|
||||
|
@ -16,6 +16,13 @@ class TestDeviantartEngine(SearxTestCase):
|
|||
self.assertTrue(query in params['url'])
|
||||
self.assertTrue('deviantart.com' in params['url'])
|
||||
|
||||
def test_no_url_in_request_year_time_range(self):
|
||||
dicto = defaultdict(dict)
|
||||
query = 'test_query'
|
||||
dicto['time_range'] = 'year'
|
||||
params = deviantart.request(query, dicto)
|
||||
self.assertEqual({}, params['url'])
|
||||
|
||||
def test_response(self):
|
||||
self.assertRaises(AttributeError, deviantart.response, None)
|
||||
self.assertRaises(AttributeError, deviantart.response, [])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue