summaryrefslogtreecommitdiff
path: root/tests/unit/engines/test_subtitleseeker.py
diff options
context:
space:
mode:
authorNoémi Ványi <kvch@users.noreply.github.com>2019-01-07 21:35:40 +0100
committerGitHub <noreply@github.com>2019-01-07 21:35:40 +0100
commit2438b3c77a3ad276aaeb15e5a54315d351a42273 (patch)
tree00d4783b39625ca01c61aa4f04cb88250b21dffc /tests/unit/engines/test_subtitleseeker.py
parent491792c1a58f71083f6af663bb6d93e40fa44c9f (diff)
parent97351a2c725ce620d452c62da07379130bafdb95 (diff)
Merge pull request #1475 from kvch/add-all-language-option-again
Revert "remove 'all' option from search languages"
Diffstat (limited to 'tests/unit/engines/test_subtitleseeker.py')
-rw-r--r--tests/unit/engines/test_subtitleseeker.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/unit/engines/test_subtitleseeker.py b/tests/unit/engines/test_subtitleseeker.py
index 96b253943..a22ee74b9 100644
--- a/tests/unit/engines/test_subtitleseeker.py
+++ b/tests/unit/engines/test_subtitleseeker.py
@@ -99,6 +99,42 @@ class TestSubtitleseekerEngine(SearxTestCase):
<div class="clear"></div>
</div>
"""
+ dicto['language'] = 'all'
+ response = mock.Mock(text=html, search_params=dicto)
+ results = subtitleseeker.response(response)
+ self.assertEqual(type(results), list)
+ self.assertEqual(len(results), 1)
+ self.assertEqual(results[0]['title'], 'This is the Title')
+ self.assertEqual(results[0]['url'], 'http://this.is.the.url/')
+ self.assertIn('1998', results[0]['content'])
+ self.assertIn('1039 Subs', results[0]['content'])
+
+ html = """
+ <div class="boxRows">
+ <div class="boxRowsInner" style="width:600px;">
+ <img src="http://static.subtitleseeker.com/images/movie.gif"
+ style="width:16px; height:16px;" class="icon">
+ <a href="http://this.is.the.url/"
+ class="blue" title="Title subtitle" >
+ This is the Title
+ </a>
+ </div>
+ <div class="boxRowsInner f12b red" style="width:70px;">
+ 1998
+ </div>
+ <div class="boxRowsInner grey-web f12" style="width:120px;">
+ <img src="http://static.subtitleseeker.com/images/basket_put.png"
+ style="width:16px; height:16px;" class="icon">
+ 1039 Subs
+ </div>
+ <div class="boxRowsInner grey-web f10" style="width:130px;">
+ <img src="http://static.subtitleseeker.com/images/arrow_refresh_small.png"
+ style="width:16px; height:16px;" class="icon">
+ 1 hours ago
+ </div>
+ <div class="clear"></div>
+ </div>
+ """
subtitleseeker.language = 'English'
response = mock.Mock(text=html, search_params=dicto)
results = subtitleseeker.response(response)