forked from premiere/premiere-libtorrent
commit
ee58035d9d
|
@ -3,6 +3,7 @@
|
|||
import libtorrent as lt
|
||||
|
||||
import unittest
|
||||
import binascii
|
||||
|
||||
# test torrent_info
|
||||
|
||||
|
@ -33,6 +34,13 @@ class test_bencoder(unittest.TestCase):
|
|||
decoded = lt.bdecode(encoded)
|
||||
self.assertEqual(decoded, {'a': 1, 'b': [1,2,3], 'c': 'foo'})
|
||||
|
||||
class test_sha1hash(unittest.TestCase):
|
||||
|
||||
def test_sha1hash(self):
|
||||
h = 'a0'*20
|
||||
s = lt.sha1_hash(binascii.unhexlify(h))
|
||||
self.assertEqual(h, str(s))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
|
|
Loading…
Reference in New Issue