コード例 #1
0
def test_download_zip_file(mocker, mock_download_from_remote, mock_unzip):
    mock_download_from_remote.return_value = "foo"
    download_utils.download_zip_file("a", "b", False, False)

    mock_download_from_remote.assert_called_once_with("a", "b", False)
    mock_unzip.assert_called_once_with("foo", cleanup=False)
    _clean("a")
コード例 #2
0
def test_download_zip_file(mocker, mock_file, mock_unzip):
    mock_file.return_value = "foo"
    download_utils.download_zip_file("a", "b", True)

    mock_file.assert_called_once_with("a", "b", True)
    mock_unzip.assert_called_once_with("foo", cleanup=True)
    if os.path.exists('a'):
        shutil.rmtree('a')
コード例 #3
0
ファイル: test_download_utils.py プロジェクト: wangyu/mirdata
def test_download_zip_file(mocker, mock_file, mock_unzip):
    mock_file.return_value = "foo"
    download_utils.download_zip_file("a", "b", True)

    mock_file.assert_called_once_with("a", "b", True)
    mock_unzip.assert_called_once_with("foo", cleanup=False)