'Testing whether the right piece progress is returned in LibtorrentDownloadImpl'

def test_get_piece_progress(self):

    self.assertEqual(self.libtorrent_download_impl.get_piece_progress(None), 1.0)
    self.libtorrent_download_impl.handle.status().pieces = [True, False]
    self.assertEqual(self.libtorrent_download_impl.get_piece_progress([0, 1], True), 0.5)
    self.libtorrent_download_impl.handle.status = (lambda : None)
    self.assertEqual(self.libtorrent_download_impl.get_piece_progress([3, 1]), 0.0)
