add python binding for generate_fingerprint
This commit is contained in:
parent
04589f3bef
commit
27001750a4
|
@ -10,6 +10,8 @@ void bind_fingerprint()
|
||||||
using namespace boost::python;
|
using namespace boost::python;
|
||||||
using namespace libtorrent;
|
using namespace libtorrent;
|
||||||
|
|
||||||
|
def("generate_fingerprint", &generate_fingerprint);
|
||||||
|
|
||||||
#ifndef TORRENT_NO_DEPRECATE
|
#ifndef TORRENT_NO_DEPRECATE
|
||||||
class_<fingerprint>("fingerprint", no_init)
|
class_<fingerprint>("fingerprint", no_init)
|
||||||
.def(
|
.def(
|
||||||
|
|
|
@ -230,6 +230,10 @@ class test_session(unittest.TestCase):
|
||||||
except KeyError as e:
|
except KeyError as e:
|
||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
|
def test_fingerprint(self):
|
||||||
|
self.assertEqual(lt.generate_fingerprint('LT', 0, 1, 2, 3), '-LT0123-')
|
||||||
|
self.assertEqual(lt.generate_fingerprint('..', 10, 1, 2, 3), '-..A123-')
|
||||||
|
|
||||||
def test_deprecated_settings(self):
|
def test_deprecated_settings(self):
|
||||||
|
|
||||||
# this detects whether libtorrent was built with deprecated APIs
|
# this detects whether libtorrent was built with deprecated APIs
|
||||||
|
|
Loading…
Reference in New Issue