Skip to content

Commit

Permalink
test fixes for python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiloti committed Jul 7, 2019
1 parent fd36d8e commit dbd2c2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindings/python/src/session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace
}
else if(key == "info_hash")
{
if (boost::python::len(value) == 40)
if (boost::python::len(value) == 40 || boost::python::len(value) == 32)
{
p.info_hash = info_hash_t(sha1_hash(
bytes(extract<bytes>(value)).arr.data()));
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_pickle_trackers(self):
pickled_trackers = pickle.dumps(self.h.trackers())
unpickled_trackers = pickle.loads(pickled_trackers)
self.assertEqual(unpickled_trackers[0]['url'], 'udp://tracker1.com')
self.assertEqual(unpickled_trackers[0]['endpoints'][0]['last_error']['value'], 0)
self.assertEqual(unpickled_trackers[0]['endpoints'][0]['info_hashes'][0]['last_error']['value'], 0)

def test_file_status(self):
self.setup()
Expand Down

0 comments on commit dbd2c2c

Please sign in to comment.