Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
searx-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
searx-engine
Commits
059c2ccb
Unverified
Commit
059c2ccb
authored
May 05, 2018
by
rinpatch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix acgsou encoding error on python2 and add unicode characters to unit testt
parent
5897343a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
acgsou.py
searx/engines/acgsou.py
+1
-1
test_acgsou.py
tests/unit/engines/test_acgsou.py
+6
-5
No files found.
searx/engines/acgsou.py
View file @
059c2ccb
...
...
@@ -63,7 +63,7 @@ def response(resp):
except
:
pass
# I didn't add download/seed/leech count since as I figured out they are generated randomly everytime
content
=
'Category: "{category}".'
content
=
u
'Category: "{category}".'
content
=
content
.
format
(
category
=
category
)
results
.
append
({
'url'
:
href
,
...
...
tests/unit/engines/test_acgsou.py
View file @
059c2ccb
# 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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment