From 11b1bdd119b941e28c9edb0895f192411c3e6a12 Mon Sep 17 00:00:00 2001 From: Carson Woods Date: Thu, 25 Jul 2019 10:39:21 -0600 Subject: [PATCH] Pep8 Compliance Fix --- lib/spack/spack/test/cmd/uninstall.py | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lib/spack/spack/test/cmd/uninstall.py b/lib/spack/spack/test/cmd/uninstall.py index 571eb97105e..8470b84d7b1 100644 --- a/lib/spack/spack/test/cmd/uninstall.py +++ b/lib/spack/spack/test/cmd/uninstall.py @@ -82,3 +82,39 @@ def test_force_uninstall_spec_with_ref_count_not_zero( all_specs = spack.store.layout.all_specs() assert len(all_specs) == expected_number_of_specs + + +@pytest.mark.db +@pytest.mark.usefixtures('mutable_database') +def test_global_recursive_uninstall(): + """Test recursive uninstall.""" + uninstall('-g', '-y', '-a', '--dependents', 'callpath') + + all_specs = spack.store.layout.all_specs() + assert len(all_specs) == 8 + # query specs with multiple configurations + mpileaks_specs = [s for s in all_specs if s.satisfies('mpileaks')] + callpath_specs = [s for s in all_specs if s.satisfies('callpath')] + mpi_specs = [s for s in all_specs if s.satisfies('mpi')] + + assert len(mpileaks_specs) == 0 + assert len(callpath_specs) == 0 + assert len(mpi_specs) == 3 + + +@pytest.mark.db +@pytest.mark.usefixtures('mutable_database') +def test_upstream_recursive_uninstall(): + """Test recursive uninstall.""" + uninstall('--upstream=global', '-y', '-a', '--dependents', 'callpath') + + all_specs = spack.store.layout.all_specs() + assert len(all_specs) == 8 + # query specs with multiple configurations + mpileaks_specs = [s for s in all_specs if s.satisfies('mpileaks')] + callpath_specs = [s for s in all_specs if s.satisfies('callpath')] + mpi_specs = [s for s in all_specs if s.satisfies('mpi')] + + assert len(mpileaks_specs) == 0 + assert len(callpath_specs) == 0 + assert len(mpi_specs) == 3