summaryrefslogtreecommitdiff
path: root/tests/unit/engines/test_wikidata.py
diff options
context:
space:
mode:
authorMarc Abonce Seguin <marc-abonce@mailbox.org>2018-04-08 23:31:24 -0500
committerMarc Abonce Seguin <marc-abonce@mailbox.org>2018-04-08 23:31:24 -0500
commit96877862269f35aefc0b3ca7a7cb8812b1555dc4 (patch)
tree3a969551bf2f3c899b12dd5a5ea2522f7b605942 /tests/unit/engines/test_wikidata.py
parentb12857a70dd947a804e667d864ba56055b528ee0 (diff)
update unit tests for google news and wikidata
Diffstat (limited to 'tests/unit/engines/test_wikidata.py')
-rw-r--r--tests/unit/engines/test_wikidata.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/tests/unit/engines/test_wikidata.py b/tests/unit/engines/test_wikidata.py
index 1ad21768c..545ef9ed8 100644
--- a/tests/unit/engines/test_wikidata.py
+++ b/tests/unit/engines/test_wikidata.py
@@ -9,20 +9,15 @@ from searx.testing import SearxTestCase
class TestWikidataEngine(SearxTestCase):
def test_request(self):
- wikidata.supported_languages = ['en', 'es']
query = 'test_query'
dicto = defaultdict(dict)
- dicto['language'] = 'en-US'
params = wikidata.request(query, dicto)
self.assertIn('url', params)
self.assertIn(query, params['url'])
self.assertIn('wikidata.org', params['url'])
- self.assertIn('en', params['url'])
- dicto['language'] = 'es-ES'
params = wikidata.request(query, dicto)
self.assertIn(query, params['url'])
- self.assertIn('es', params['url'])
# successful cases are not tested here to avoid sending additional requests
def test_response(self):
@@ -31,6 +26,7 @@ class TestWikidataEngine(SearxTestCase):
self.assertRaises(AttributeError, wikidata.response, '')
self.assertRaises(AttributeError, wikidata.response, '[]')
+ wikidata.supported_languages = ['en', 'es']
response = mock.Mock(text='<html></html>', search_params={"language": "en"})
self.assertEqual(wikidata.response(response), [])