1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-09 09:59:51 +01:00

add a test for parse_page

This commit is contained in:
Viktor Stanchev 2015-09-03 20:35:12 -07:00
parent cecc8ba68b
commit d0a9d0f51e
5 changed files with 491 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -3,10 +3,13 @@ import unittest
import pirate.local
import os
from tests import util
class TestLocal(unittest.TestCase):
def test_rich_xml(self):
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'rich.xml')
path = util.data_path('rich.xml')
expected = [['magnet:?xt=urn:btih:b03c8641415d3a0fc7077f5bf567634442989a74&dn=High.Chaparall.S02E02.PDTV.XViD.SWEDiSH-HuBBaTiX', '?', '?']]
actual = pirate.local.search(path, ('High',))
self.assertEqual(actual, expected)

18
tests/test_torrent.py Executable file

File diff suppressed because one or more lines are too long

8
tests/util.py Normal file
View File

@ -0,0 +1,8 @@
import os
def data_path(name):
return os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data', name)
def read_data(name):
with open(data_path(name)) as f:
return f.read()