def METHOD_NAME(mock_download, mock_tdef):
    """
    Testing whether the right completion of files is returned
    """
    mock_tdef.get_files_with_length = lambda: [("test.txt", 100)]
    handle = Mock()
    handle.file_progress = lambda **_: [60]
    handle.is_valid = lambda: True
    mock_download.handle = handle
    download_state = DownloadState(mock_download, Mock(), None)
    assert download_state.get_files_completion() == [('test.txt', 0.6)]
    handle.file_progress = lambda **_: [0]
    assert download_state.get_files_completion() == [('test.txt', 0.0)]
    handle.file_progress = lambda **_: [100]
    assert download_state.get_files_completion() == [('test.txt', 1.0)]
    mock_tdef.get_files_with_length = lambda: []
    handle.file_progress = lambda **_: []
    assert download_state.get_files_completion() == []
    # Test a file with a length of zero
    mock_tdef.get_files_with_length = lambda: [("test.txt", 0)]
    handle.file_progress = lambda **_: [0]
    assert download_state.get_files_completion() == [('test.txt', 1.0)]
    # Test a file with empty file progress
    mock_tdef.get_files_with_length = lambda: [("test.txt", 0)]
    handle.file_progress = lambda **_: []
    assert download_state.get_files_completion() == []