'Testing whether the right completion of files is returned'

def test_get_files_completion(self):

    self.mock_download.get_selected_files = (lambda : [['test.txt', 42]])
    download_state = DownloadState(self.mock_download, DLSTATUS_DOWNLOADING, None, 0.6)
    self.assertEqual(download_state.get_files_completion(), [(['test.txt', 42], 0.6)])
    download_state.filepieceranges = [(5, 10, None, ['test.txt', 42])]
    self.assertEqual(download_state.get_files_completion(), [(['test.txt', 42], 0.0)])
    download_state.progress = 1.0
    self.assertEqual(download_state.get_files_completion(), [(['test.txt', 42], 1.0)])
    self.mock_download.get_selected_files = (lambda : [['test.txt', 42], ['test2.txt', 43]])
    self.assertEqual(download_state.get_files_completion(), [(['test.txt', 42], 1.0)])
