def test_fetch_data_files(): """Test fetch_data_files().""" # Remove a single file from the cache cache = get_data_dir() path = cache / "693_J2KR.dcm" if path.exists(): path.unlink() assert not path.exists() fetch_data_files() assert path.exists()
def test_fetch_data_files_download_failure(download_failure): """Test fetch_data_files() with download failures.""" msg = r"An error occurred downloading the following files:" with pytest.raises(RuntimeError, match=msg): fetch_data_files()