summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorrinpatch <rinpatch@airmail.cc>2018-05-05 23:41:13 +0300
committerrinpatch <rinpatch@airmail.cc>2018-05-05 23:41:13 +0300
commit059c2ccb9576f8aae36b4e1c0bf6a024d75701ea (patch)
treeb0e41aa025e1e7f07416129313cd6efeddf5f901 /tests
parent5897343ab281a129d723e57c5e40531b4dab8b8b (diff)
downloadsearxng-059c2ccb9576f8aae36b4e1c0bf6a024d75701ea.tar.gz
searxng-059c2ccb9576f8aae36b4e1c0bf6a024d75701ea.zip
Fix acgsou encoding error on python2 and add unicode characters to unit testt
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/engines/test_acgsou.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unit/engines/test_acgsou.py b/tests/unit/engines/test_acgsou.py
index f97749cc1..c01acf5de 100644
--- a/tests/unit/engines/test_acgsou.py
+++ b/tests/unit/engines/test_acgsou.py
@@ -1,3 +1,4 @@
+# coding=utf-8
from collections import defaultdict
import mock
from searx.engines import acgsou
@@ -19,7 +20,7 @@ class TestAcgsouEngine(SearxTestCase):
resp = mock.Mock(text='<html></html>')
self.assertEqual(acgsou.response(resp), [])
- html = """
+ html = u"""
<html>
<table id="listTable" class="list_style table_fixed">
<thead class="tcat">
@@ -37,9 +38,9 @@ class TestAcgsouEngine(SearxTestCase):
<tbody class="tbody" id="data_list">
<tr class="alt1 ">
<td nowrap="nowrap">date</td>
- <td><a href="category.html">testcategory</a></td>
+ <td><a href="category.html">testcategory テスト</a></td>
<td style="text-align:left;">
- <a href="show-torrentid.html" target="_blank">torrentname</a>
+ <a href="show-torrentid.html" target="_blank">torrentname テスト</a>
</td>
<td>1MB</td>
<td nowrap="nowrap">
@@ -72,6 +73,6 @@ class TestAcgsouEngine(SearxTestCase):
r = results[0]
self.assertEqual(r['url'], 'http://www.acgsou.com/show-torrentid.html')
- self.assertEqual(r['content'], 'Category: "testcategory".')
- self.assertEqual(r['title'], 'torrentname')
+ self.assertEqual(r['content'], u'Category: "testcategory テスト".')
+ self.assertEqual(r['title'], u'torrentname テスト')
self.assertEqual(r['filesize'], 1048576)