summaryrefslogtreecommitdiff
path: root/lib/spack/spack/test/fetch_strategy.py
blob: 59c645d4e01997c3d266e8bf2747531c79f05e0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Copyright 2013-2023 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 import fetch_strategy


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 = fetch_strategy.from_url_scheme("bogus-scheme://example.com/a/b/c")  # noqa: F841