summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormarc <a01200356@itesm.mx>2016-10-29 21:04:01 -0500
committermarc <a01200356@itesm.mx>2016-12-13 19:32:43 -0600
commita11948c71bfe7b2aac6e50e7634874d5073c7d84 (patch)
treec5d5c52ca459ba89b2e36d2e87ce3e250be6c896 /tests
parenta11230819ff76312b4528b2bfb6e03d0560075b1 (diff)
downloadsearxng-a11948c71bfe7b2aac6e50e7634874d5073c7d84.tar.gz
searxng-a11948c71bfe7b2aac6e50e7634874d5073c7d84.zip
Add language support for more engines.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/engines/test_duckduckgo.py2
-rw-r--r--tests/unit/engines/test_duckduckgo_definitions.py4
-rw-r--r--tests/unit/engines/test_google.py2
-rw-r--r--tests/unit/engines/test_qwant.py2
-rw-r--r--tests/unit/engines/test_swisscows.py2
-rw-r--r--tests/unit/engines/test_wikipedia.py2
6 files changed, 9 insertions, 5 deletions
diff --git a/tests/unit/engines/test_duckduckgo.py b/tests/unit/engines/test_duckduckgo.py
index 734f2c39e..b5a4fd4f0 100644
--- a/tests/unit/engines/test_duckduckgo.py
+++ b/tests/unit/engines/test_duckduckgo.py
@@ -11,7 +11,7 @@ class TestDuckduckgoEngine(SearxTestCase):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 1
- dicto['language'] = 'de_CH'
+ dicto['language'] = 'de-CH'
dicto['time_range'] = ''
params = duckduckgo.request(query, dicto)
self.assertIn('url', params)
diff --git a/tests/unit/engines/test_duckduckgo_definitions.py b/tests/unit/engines/test_duckduckgo_definitions.py
index 39da64175..feafe47ba 100644
--- a/tests/unit/engines/test_duckduckgo_definitions.py
+++ b/tests/unit/engines/test_duckduckgo_definitions.py
@@ -21,10 +21,14 @@ class TestDDGDefinitionsEngine(SearxTestCase):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 1
+ dicto['language'] = 'es'
params = duckduckgo_definitions.request(query, dicto)
self.assertIn('url', params)
self.assertIn(query, params['url'])
self.assertIn('duckduckgo.com', params['url'])
+ self.assertIn('headers', params)
+ self.assertIn('Accept-Language', params['headers'])
+ self.assertIn('es', params['headers']['Accept-Language'])
def test_response(self):
self.assertRaises(AttributeError, duckduckgo_definitions.response, None)
diff --git a/tests/unit/engines/test_google.py b/tests/unit/engines/test_google.py
index 8e73e2ab7..c83eb3bf0 100644
--- a/tests/unit/engines/test_google.py
+++ b/tests/unit/engines/test_google.py
@@ -18,7 +18,7 @@ class TestGoogleEngine(SearxTestCase):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 1
- dicto['language'] = 'fr_FR'
+ dicto['language'] = 'fr-FR'
dicto['time_range'] = ''
params = google.request(query, dicto)
self.assertIn('url', params)
diff --git a/tests/unit/engines/test_qwant.py b/tests/unit/engines/test_qwant.py
index 7d79d13d8..c4c0b0690 100644
--- a/tests/unit/engines/test_qwant.py
+++ b/tests/unit/engines/test_qwant.py
@@ -10,7 +10,7 @@ class TestQwantEngine(SearxTestCase):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 0
- dicto['language'] = 'fr_FR'
+ dicto['language'] = 'fr-FR'
qwant.categories = ['']
params = qwant.request(query, dicto)
self.assertIn('url', params)
diff --git a/tests/unit/engines/test_swisscows.py b/tests/unit/engines/test_swisscows.py
index 3b4ce7b0f..dbbc044da 100644
--- a/tests/unit/engines/test_swisscows.py
+++ b/tests/unit/engines/test_swisscows.py
@@ -10,7 +10,7 @@ class TestSwisscowsEngine(SearxTestCase):
query = 'test_query'
dicto = defaultdict(dict)
dicto['pageno'] = 1
- dicto['language'] = 'de_DE'
+ dicto['language'] = 'de-DE'
params = swisscows.request(query, dicto)
self.assertTrue('url' in params)
self.assertTrue(query in params['url'])
diff --git a/tests/unit/engines/test_wikipedia.py b/tests/unit/engines/test_wikipedia.py
index d1c44036d..431cf69c7 100644
--- a/tests/unit/engines/test_wikipedia.py
+++ b/tests/unit/engines/test_wikipedia.py
@@ -10,7 +10,7 @@ class TestWikipediaEngine(SearxTestCase):
def test_request(self):
query = 'test_query'
dicto = defaultdict(dict)
- dicto['language'] = 'fr_FR'
+ dicto['language'] = 'fr-FR'
params = wikipedia.request(query, dicto)
self.assertIn('url', params)
self.assertIn(query, params['url'])