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:
parent
cecc8ba68b
commit
d0a9d0f51e
461
tests/data/dan_bull_search.html
Normal file
461
tests/data/dan_bull_search.html
Normal file
File diff suppressed because one or more lines are too long
@ -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
18
tests/test_torrent.py
Executable file
File diff suppressed because one or more lines are too long
8
tests/util.py
Normal file
8
tests/util.py
Normal 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()
|
Loading…
Reference in New Issue
Block a user