add test for add_torrent() failing with an exception in the python binding

This commit is contained in:
Arvid Norberg 2020-04-18 10:54:41 +02:00 committed by Arvid Norberg
parent 1bec6b49f5
commit 9de99ac55c
1 changed files with 6 additions and 0 deletions

View File

@ -87,6 +87,12 @@ class test_torrent_handle(unittest.TestCase):
'ti': self.ti, 'save_path': os.getcwd(),
'flags': lt.torrent_flags.default_flags})
def test_add_torrent_error(self):
self.ses = lt.session(settings)
self.ti = lt.torrent_info('url_seed_multi.torrent')
with self.assertRaises(RuntimeError):
self.ses.add_torrent({'ti': self.ti, 'save_path': os.getcwd(), 'info_hash': b'abababababababababab'})
def test_torrent_handle(self):
self.setup()
self.assertEqual(self.h.get_file_priorities(), [4, 4])