versions.py 1.65 KB
Newer Older
1
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
2
# Spack Project Developers. See the top-level COPYRIGHT file for details.
3
#
4
5
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

6
import pytest
7

8
from spack.main import SpackCommand
9
10
11
12

versions = SpackCommand('versions')


13
14
15
16
17
18
19
def test_safe_only_versions():
    """Only test the safe versions of a package.
       (Using the deprecated command line argument)
    """
    versions('--safe-only', 'zlib')


20
21
22
def test_safe_versions():
    """Only test the safe versions of a package."""

23
    versions('--safe', 'zlib')
24
25


26
@pytest.mark.maybeslow
27
28
29
30
31
32
def test_remote_versions():
    """Test a package for which remote versions should be available."""

    versions('zlib')


33
@pytest.mark.maybeslow
34
35
36
37
38
39
def test_remote_versions_only():
    """Test a package for which remote versions should be available."""

    versions('--remote', 'zlib')


40
@pytest.mark.maybeslow
41
42
43
44
45
46
47
@pytest.mark.usefixtures('mock_packages')
def test_new_versions_only():
    """Test a package for which new versions should be available."""

    versions('--new', 'brillig')


48
@pytest.mark.maybeslow
49
50
51
52
53
54
def test_no_versions():
    """Test a package for which no remote versions are available."""

    versions('converge')


55
@pytest.mark.maybeslow
56
57
58
59
def test_no_unchecksummed_versions():
    """Test a package for which no unchecksummed versions are available."""

    versions('bzip2')
60
61


62
@pytest.mark.maybeslow
63
64
65
66
67
68
def test_versions_no_url():
    """Test a package with versions but without a ``url`` attribute."""

    versions('graphviz')


69
@pytest.mark.maybeslow
70
71
72
73
def test_no_versions_no_url():
    """Test a package without versions or a ``url`` attribute."""

    versions('opengl')