示例#1
0
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)
示例#2
0
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)
示例#3
0
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)
示例#4
0
def test_get_tox21_filepath_assert_raises():
    with pytest.raises(ValueError):
        tox21.get_tox21_filepath('other')
示例#5
0
def test_get_tox21_filepath_assert_raises():
    with pytest.raises(ValueError):
        tox21.get_tox21_filepath('other')