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")
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')
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)