Skip to content

Instantly share code, notes, and snippets.

@lfdversluis
Created June 9, 2016 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lfdversluis/19965643ed738c24846020e843546b97 to your computer and use it in GitHub Desktop.
Save lfdversluis/19965643ed738c24846020e843546b97 to your computer and use it in GitHub Desktop.
Ardhi test example fix
deferred(timeout=20)
def test_save_resume(self):
tdef = TorrentDef()
sourcefn = os.path.join(TESTS_DATA_DIR, 'video.avi')
tdef.add_content(sourcefn)
tdef.set_tracker("http://localhost/announce")
tdef.finalize()
torrentfn = os.path.join(self.session.get_state_dir(), "gen.torrent")
tdef.save(torrentfn)
impl = LibtorrentDownloadImpl(self.session, tdef)
def callback((ignored, ignored2)):
return impl.save_resume_data()
result_deferred = impl.setup(None, None, None, 0)
result_deferred.addCallback(callback)
return result_deferred
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment