From 0e7071befe0943e55ee585e3998bd0c262d5a233 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 24 Aug 2017 08:47:52 -0400 Subject: test/gpg: init from the testing key directory The old testing pattern set an attribute on the parser directly. Now that there is a parsed flag, use it instead. --- lib/spack/spack/test/cmd/gpg.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/test/cmd/gpg.py b/lib/spack/spack/test/cmd/gpg.py index 97f7accd60..111436f24f 100644 --- a/lib/spack/spack/test/cmd/gpg.py +++ b/lib/spack/spack/test/cmd/gpg.py @@ -39,14 +39,6 @@ def testing_gpg_directory(tmpdir): gpg_util.GNUPGHOME = old_gpg_path -@pytest.fixture(scope='function') -def mock_gpg_config(): - orig_gpg_keys_path = spack.gpg_keys_path - spack.gpg_keys_path = spack.mock_gpg_keys_path - yield - spack.gpg_keys_path = orig_gpg_keys_path - - @pytest.fixture(scope='function') def gpg(): return SpackCommand('gpg') @@ -60,16 +52,15 @@ def has_gnupg2(): return False -@pytest.mark.xfail # TODO: fix failing tests. @pytest.mark.skipif(not has_gnupg2(), reason='These tests require gnupg2') -def test_gpg(gpg, tmpdir, testing_gpg_directory, mock_gpg_config): +def test_gpg(gpg, tmpdir, testing_gpg_directory): # Verify a file with an empty keyring. with pytest.raises(ProcessError): gpg('verify', os.path.join(spack.mock_gpg_data_path, 'content.txt')) # Import the default key. - gpg('init') + gpg('init', '--from', spack.mock_gpg_keys_path) # List the keys. # TODO: Test the output here. -- cgit v1.2.3-60-g2f50