def test_get_tox21_filepath_without_download(dataset_type): filepath = tox21.get_tox21_filepath(dataset_type, download_if_not_exist=False) if os.path.exists(filepath): os.remove(filepath) # ensure a cache file does not exist. filepath = tox21.get_tox21_filepath(dataset_type, download_if_not_exist=False) assert isinstance(filepath, str) assert not os.path.exists(filepath)
def test_get_tox21_filepath_with_download(dataset_type): filepath = tox21.get_tox21_filepath(dataset_type, download_if_not_exist=False) if os.path.exists(filepath): os.remove(filepath) # ensure a cache file does not exist. # This method downloads the file if not exist filepath = tox21.get_tox21_filepath(dataset_type, download_if_not_exist=True) assert isinstance(filepath, str) assert os.path.exists(filepath) os.remove(filepath)
def test_get_tox21_filepath_assert_raises(): with pytest.raises(ValueError): tox21.get_tox21_filepath('other')