Exemplo n.º 1
0
    def test_get_files_details(self):
        """ Test getting the name, length and checksum of the files inside a valid torrent file. """
        import os

        for torrent_file in TORRENTS_INFO:
            tp = TorrentParser("test_data/%s" % torrent_file)
            self.assertItemsEqual(tp.get_files_details(), TORRENTS_INFO[torrent_file]["file_details"])
Exemplo n.º 2
0
from torrentparser import TorrentParser

torrent_info = TorrentParser('test_torrents/rs.torrent')

x =  torrent_info.get_files_details()

print type(x)

for t in x:
    #print t
    print "Name: %s, Size: %d" %(t[0], t[1])