summaryrefslogtreecommitdiff
path: root/lib/spack/spack/test/package_sanity.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/spack/test/package_sanity.py')
-rw-r--r--lib/spack/spack/test/package_sanity.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/spack/spack/test/package_sanity.py b/lib/spack/spack/test/package_sanity.py
index 370cf676ef..ee09040d0d 100644
--- a/lib/spack/spack/test/package_sanity.py
+++ b/lib/spack/spack/test/package_sanity.py
@@ -28,16 +28,15 @@ This test does sanity checks on Spack's builtin package database.
import unittest
import spack
-import spack.url as url
-from spack.packages import PackageDB
+from spack.repository import RepoPath
class PackageSanityTest(unittest.TestCase):
def check_db(self):
"""Get all packages in a DB to make sure they work."""
- for name in spack.db.all_package_names():
- spack.db.get(name)
+ for name in spack.repo.all_package_names():
+ spack.repo.get(name)
def test_get_all_packages(self):
@@ -47,15 +46,15 @@ class PackageSanityTest(unittest.TestCase):
def test_get_all_mock_packages(self):
"""Get the mock packages once each too."""
- tmp = spack.db
- spack.db = PackageDB(spack.mock_packages_path)
+ db = RepoPath(spack.mock_packages_path)
+ spack.repo.swap(db)
self.check_db()
- spack.db = tmp
+ spack.repo.swap(db)
def test_url_versions(self):
"""Check URLs for regular packages, if they are explicitly defined."""
- for pkg in spack.db.all_packages():
+ for pkg in spack.repo.all_packages():
for v, vattrs in pkg.versions.items():
if 'url' in vattrs:
# If there is a url for the version check it.