コード例 #1
0
ファイル: s3_fetch.py プロジェクト: eic/spack
def test_s3fetchstrategy_bad_url(tmpdir):
    """Ensure fetch with bad URL fails as expected."""
    testpath = str(tmpdir)

    fetcher = spack_fs.S3FetchStrategy(url='file:///does-not-exist')
    assert fetcher is not None

    with spack_stage.Stage(fetcher, path=testpath) as stage:
        assert stage is not None
        assert fetcher.archive_file is None
        with pytest.raises(spack_fs.FetchError):
            fetcher.fetch()
コード例 #2
0
ファイル: s3_fetch.py プロジェクト: wrwilliams/spack
def test_s3fetchstrategy_sans_url(_fetch_method):
    """Ensure constructor with no URL fails."""
    with spack_config.override('config:url_fetch_method', _fetch_method):
        with pytest.raises(ValueError):
            spack_fs.S3FetchStrategy(None)
コード例 #3
0
ファイル: s3_fetch.py プロジェクト: eic/spack
def test_s3fetchstrategy_sans_url():
    """Ensure constructor with no URL fails."""
    with pytest.raises(ValueError):
        spack_fs.S3FetchStrategy(None)