'Remove an existing download.'

def test_remove_download_by_id_nonempty(self):

    infohash = 'abc'
    download = MockObject()
    torrent_def = MockObject()
    torrent_def.get_infohash = (lambda : infohash)
    download.get_def = (lambda : torrent_def)
    self.session.get_downloads = (lambda : [download])
    self.called = False
    def verify_remove_download_called(*args, **kwargs):
        self.called = True
    self.session.remove_download = verify_remove_download_called
    self.session.remove_download_by_id(infohash)
    self.assertTrue(self.called)
