@@ -65,12 +65,39 @@ class TestPiratebayEngine(SearxTestCase):
65 <td align="right">13</td>
65 <td align="right">13</td>
66 <td align="right">334</td>
66 <td align="right">334</td>
71+ <a href="#" title="More from this category">Anime</a><br/>
72+ (<a href="#" title="More from this category">Anime</a>)
76+ <div class="detName">
77+ <a href="/this.is.the.link" class="detLink" title="Title">
81+ <a href="magnet:?xt=urn:btih:MAGNETLINK" title="Download this torrent using magnet">
82+ <img src="/static/img/icon-magnet.gif" alt="Magnet link"/>
84+ <a href="/user/HorribleSubs">
85+ <img src="/static/img/vip.gif" alt="VIP" title="VIP" style="width:11px;" border='0'/>
87+ <img src="/static/img/11x11p.png"/>
88+ <font class="detDesc">
89+ This is the content <span>and should be</span> OK
92+ <td align="right">13</td>
93+ <td align="right">334</td>
70 response = mock.Mock(text=html)
97 response = mock.Mock(text=html)
71 results = piratebay.response(response)
98 results = piratebay.response(response)
72 self.assertEqual(type(results), list)
99 self.assertEqual(type(results), list)
73− self.assertEqual(len(results), 1)
100+ self.assertEqual(len(results), 2)
74 self.assertEqual(results[0]['title'], 'This is the title')
101 self.assertEqual(results[0]['title'], 'This is the title')
75 self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link')
102 self.assertEqual(results[0]['url'], 'https://thepiratebay.se/this.is.the.link')
76 self.assertEqual(results[0]['content'], 'This is the content and should be OK')
103 self.assertEqual(results[0]['content'], 'This is the content and should be OK')
@@ -79,6 +106,8 @@ class TestPiratebayEngine(SearxTestCase):
79 self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETLINK')
106 self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETLINK')
80 self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/TORRENTFILE.torrent')
107 self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/TORRENTFILE.torrent')
109+ self.assertEqual(results[1]['torrentfile'], None)
82 html = """
111 html = """
83 <table id="searchResult">
112 <table id="searchResult">