summaryrefslogtreecommitdiff
path: root/searx/tests
diff options
context:
space:
mode:
authordalf <alex@al-f.net>2015-02-12 12:30:03 +0100
committerdalf <alex@al-f.net>2015-02-12 14:30:03 +0100
commit9db0bbc30421cec9d42438ccab748439eea60105 (patch)
tree1da63f3ee4af003e6da5b1a59c9c27a700ca16d0 /searx/tests
parentf8a5f7d6751ad72c877d6008f1a7d9792ba911f6 (diff)
[fix] kickass engine : change the hostname to kickass.to (since kickass.so doesn't respond).
Close #197 perhaps not in clean way. Explanation : In fact 301 responses are followed, except the hook is called for each HTTP response, the first time for the HTTP 301 response then for HTTP 200 response. Since the kickass engine excepts a real result, the engine crashes, AND the requests lib stops here. Add a simple test at the beginning of the result function allows pass the first response and handle correctly the second response (the real one) May be a proper way is to add this test in search.py ? Code inside requests : https://github.com/kennethreitz/requests/blob/53d02381e22436b6d0757eb305eb1a960f82d361/requests/sessions.py#L579 and line 591
Diffstat (limited to 'searx/tests')
-rw-r--r--searx/tests/engines/test_kickass.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/tests/engines/test_kickass.py b/searx/tests/engines/test_kickass.py
index 3c20a97e7..971d0847e 100644
--- a/searx/tests/engines/test_kickass.py
+++ b/searx/tests/engines/test_kickass.py
@@ -14,7 +14,7 @@ class TestKickassEngine(SearxTestCase):
params = kickass.request(query, dicto)
self.assertIn('url', params)
self.assertIn(query, params['url'])
- self.assertIn('kickass.so', params['url'])
+ self.assertIn('kickass.to', params['url'])
self.assertIn('verify', params)
self.assertFalse(params['verify'])
@@ -98,7 +98,7 @@ class TestKickassEngine(SearxTestCase):
self.assertEqual(type(results), list)
self.assertEqual(len(results), 1)
self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'https://kickass.so/url.html')
+ self.assertEqual(results[0]['url'], 'https://kickass.to/url.html')
self.assertEqual(results[0]['content'], 'Posted by riri in Other &gt; Unsorted')
self.assertEqual(results[0]['seed'], 10)
self.assertEqual(results[0]['leech'], 1)
@@ -381,7 +381,7 @@ class TestKickassEngine(SearxTestCase):
self.assertEqual(type(results), list)
self.assertEqual(len(results), 5)
self.assertEqual(results[0]['title'], 'This should be the title')
- self.assertEqual(results[0]['url'], 'https://kickass.so/url.html')
+ self.assertEqual(results[0]['url'], 'https://kickass.to/url.html')
self.assertEqual(results[0]['content'], 'Posted by riri in Other &gt; Unsorted')
self.assertEqual(results[0]['seed'], 10)
self.assertEqual(results[0]['leech'], 1)