summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/test/cmd/list.py34
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/spack/spack/test/cmd/list.py b/lib/spack/spack/test/cmd/list.py
index 9fe335a6e3..976bacb9fb 100644
--- a/lib/spack/spack/test/cmd/list.py
+++ b/lib/spack/spack/test/cmd/list.py
@@ -55,7 +55,7 @@ def mock_name_only(monkeypatch, pkg_names):
@pytest.mark.usefixtures('mock_name_only')
class TestListCommand(object):
- def test_list_without_filters(self, parser, pkg_names):
+ def test_list(self, parser, pkg_names):
args = parser.parse_args([])
spack.cmd.list.list(parser, args)
@@ -64,10 +64,40 @@ class TestListCommand(object):
assert 'cloverleaf3d' in pkg_names
assert 'hdf5' in pkg_names
- def test_list_with_filters(self, parser, pkg_names):
+ def test_list_filter(self, parser, pkg_names):
+ args = parser.parse_args(['py-*'])
+ spack.cmd.list.list(parser, args)
+
+ assert pkg_names
+ assert 'py-numpy' in pkg_names
+ assert 'perl-file-copy-recursive' not in pkg_names
+
+ args = parser.parse_args(['py-'])
+ spack.cmd.list.list(parser, args)
+
+ assert pkg_names
+ assert 'py-numpy' in pkg_names
+ assert 'perl-file-copy-recursive' in pkg_names
+
+ def test_list_search_description(self, parser, pkg_names):
+ args = parser.parse_args(['--search-description', 'xml'])
+ spack.cmd.list.list(parser, args)
+
+ assert pkg_names
+ assert 'expat' in pkg_names
+
+ def test_list_tags(self, parser, pkg_names):
args = parser.parse_args(['--tags', 'proxy-app'])
spack.cmd.list.list(parser, args)
assert pkg_names
assert 'cloverleaf3d' in pkg_names
assert 'hdf5' not in pkg_names
+
+ def test_list_formatter(self, parser, pkg_names):
+ # TODO: Test the output of the commands
+ args = parser.parse_args(['--format', 'name_only'])
+ spack.cmd.list.list(parser, args)
+
+ args = parser.parse_args(['--format', 'rst'])
+ spack.cmd.list.list(parser, args)