Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 4
0
def test_get_tox21_filepath_assert_raises():
    with pytest.raises(ValueError):
        tox21.get_tox21_filepath('other')
Exemplo n.º 5
0
def test_get_tox21_filepath_assert_raises():
    with pytest.raises(ValueError):
        tox21.get_tox21_filepath('other')