summaryrefslogtreecommitdiff
path: root/searx/tests
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-06-02 22:11:47 +0200
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-06-02 22:11:47 +0200
commite0774c849c48373c7a49515d5d769c5868596494 (patch)
tree2bd82c4a4c813a3102a07fc058764983fa215013 /searx/tests
parentf05087b93ac1ebef3bdacd353524bac0d8041832 (diff)
downloadsearxng-e0774c849c48373c7a49515d5d769c5868596494.tar.gz
searxng-e0774c849c48373c7a49515d5d769c5868596494.zip
Removed the keywords from the settings in qwant engine
Diffstat (limited to 'searx/tests')
-rw-r--r--searx/tests/engines/test_qwant.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/searx/tests/engines/test_qwant.py b/searx/tests/engines/test_qwant.py
index 6da4745b1..7d79d13d8 100644
--- a/searx/tests/engines/test_qwant.py
+++ b/searx/tests/engines/test_qwant.py
@@ -11,15 +11,19 @@ class TestQwantEngine(SearxTestCase):
dicto = defaultdict(dict)
dicto['pageno'] = 0
dicto['language'] = 'fr_FR'
+ qwant.categories = ['']
params = qwant.request(query, dicto)
self.assertIn('url', params)
self.assertIn(query, params['url'])
+ self.assertIn('web', params['url'])
self.assertIn('qwant.com', params['url'])
self.assertIn('fr_fr', params['url'])
dicto['language'] = 'all'
+ qwant.categories = ['news']
params = qwant.request(query, dicto)
self.assertFalse('fr' in params['url'])
+ self.assertIn('news', params['url'])
def test_response(self):
self.assertRaises(AttributeError, qwant.response, None)
@@ -68,7 +72,7 @@ class TestQwantEngine(SearxTestCase):
}
"""
response = mock.Mock(text=json)
- qwant.search_url_keyword = 'web'
+ qwant.categories = ['general']
results = qwant.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)
@@ -113,7 +117,7 @@ class TestQwantEngine(SearxTestCase):
}
"""
response = mock.Mock(text=json)
- qwant.search_url_keyword = 'images'
+ qwant.categories = ['images']
results = qwant.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)
@@ -158,7 +162,7 @@ class TestQwantEngine(SearxTestCase):
}
"""
response = mock.Mock(text=json)
- qwant.search_url_keyword = 'news'
+ qwant.categories = ['news']
results = qwant.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)
@@ -202,7 +206,7 @@ class TestQwantEngine(SearxTestCase):
}
"""
response = mock.Mock(text=json)
- qwant.search_url_keyword = 'social'
+ qwant.categories = ['social media']
results = qwant.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)
@@ -246,7 +250,7 @@ class TestQwantEngine(SearxTestCase):
}
"""
response = mock.Mock(text=json)
- qwant.search_url_keyword = ''
+ qwant.categories = ['']
results = qwant.response(response)
self.assertEqual(type(results), list)
self.assertEqual(len(results), 0)