summaryrefslogtreecommitdiff
path: root/lib/spack/spack/test/fetch_strategy.py
blob: 5470d88c13a7a37a6ebc9003f465bc109c204f1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import pytest

from spack.fetch_strategy import from_url_scheme


def test_fetchstrategy_bad_url_scheme():
    """Ensure that trying to make a fetch strategy from a URL with an
    unsupported scheme fails as expected."""

    with pytest.raises(ValueError):
        fetcher = from_url_scheme(  # noqa: F841
            'bogus-scheme://example.com/a/b/c')