diff --git a/bindings/python/test.py b/bindings/python/test.py index a3e4b5dbf..a54dd315a 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -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()