Expose torrent_alert::torrent_name in python bindings (#2449)

This commit is contained in:
Andrew Resch 2017-10-15 14:53:44 -07:00 committed by Arvid Norberg
parent 6214103619
commit 9f6631bfbe
2 changed files with 3 additions and 0 deletions

View File

@ -235,6 +235,7 @@ void bind_alert()
class_<torrent_alert, bases<alert>, noncopyable>(
"torrent_alert", no_init)
.add_property("handle", make_getter(&torrent_alert::handle, by_value()))
.add_property("torrent_name", &torrent_alert::torrent_name)
;
class_<tracker_alert, bases<torrent_alert>, noncopyable>(

View File

@ -231,6 +231,8 @@ class test_alerts(unittest.TestCase):
ses.wait_for_alert(1000) # milliseconds
alerts = ses.pop_alerts()
for a in alerts:
if a.what() == 'add_torrent_alert':
self.assertEquals(a.torrent_name, 'temp')
print(a.message())
for field_name in dir(a):
if field_name.startswith('__'): continue