|
@@ -1,3 +1,4 @@
|
|
1
|
+# -*- coding: utf-8 -*-
|
1
|
2
|
from collections import defaultdict
|
2
|
3
|
import mock
|
3
|
4
|
from searx.engines import duckduckgo
|
|
@@ -30,7 +31,7 @@ class TestDuckduckgoEngine(SearxTestCase):
|
30
|
31
|
response = mock.Mock(text='<html></html>')
|
31
|
32
|
self.assertEqual(duckduckgo.response(response), [])
|
32
|
33
|
|
33
|
|
- html = """
|
|
34
|
+ html = u"""
|
34
|
35
|
<div class="results_links results_links_deep web-result">
|
35
|
36
|
<div class="icon_fav" style="display: block;">
|
36
|
37
|
<a rel="nofollow" href="https://www.test.com/">
|
|
@@ -39,7 +40,7 @@ class TestDuckduckgoEngine(SearxTestCase):
|
39
|
40
|
</a>
|
40
|
41
|
</div>
|
41
|
42
|
<div class="links_main links_deep"> <!-- This is the visible part -->
|
42
|
|
- <a rel="nofollow" class="large" href="http://this.should.be.the.link/">
|
|
43
|
+ <a rel="nofollow" class="large" href="http://this.should.be.the.link/ű">
|
43
|
44
|
This <b>is</b> <b>the</b> title
|
44
|
45
|
</a>
|
45
|
46
|
<div class="snippet"><b>This</b> should be the content.</div>
|
|
@@ -54,7 +55,7 @@ class TestDuckduckgoEngine(SearxTestCase):
|
54
|
55
|
self.assertEqual(type(results), list)
|
55
|
56
|
self.assertEqual(len(results), 1)
|
56
|
57
|
self.assertEqual(results[0]['title'], 'This is the title')
|
57
|
|
- self.assertEqual(results[0]['url'], 'http://this.should.be.the.link/')
|
|
58
|
+ self.assertEqual(results[0]['url'], u'http://this.should.be.the.link/ű')
|
58
|
59
|
self.assertEqual(results[0]['content'], 'This should be the content.')
|
59
|
60
|
|
60
|
61
|
html = """
|