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