From 52d243f7af259bb888ead2284c82a5a23caadb9d Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Sun, 29 Mar 2015 21:05:43 +0200 Subject: [fix] piratebay: missing torrent link --- searx/tests/engines/test_piratebay.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'searx/tests') diff --git a/searx/tests/engines/test_piratebay.py b/searx/tests/engines/test_piratebay.py index 17bc3a526..5699380be 100644 --- a/searx/tests/engines/test_piratebay.py +++ b/searx/tests/engines/test_piratebay.py @@ -65,12 +65,39 @@ class TestPiratebayEngine(SearxTestCase): 13 334 + + +
+ Anime
+ (Anime) +
+ + +
+ + This is the title + +
+ + Magnet link + + + VIP + + + + This is the content and should be OK + + + 13 + 334 + """ response = mock.Mock(text=html) results = piratebay.response(response) self.assertEqual(type(results), list) - self.assertEqual(len(results), 1) + self.assertEqual(len(results), 2) self.assertEqual(results[0]['title'], 'This is the title') self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link') self.assertEqual(results[0]['content'], 'This is the content and should be OK') @@ -79,6 +106,8 @@ class TestPiratebayEngine(SearxTestCase): self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETLINK') self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/TORRENTFILE.torrent') + self.assertEqual(results[1]['torrentfile'], None) + html = """ -- cgit v1.2.3