tests: fix failing test_hash_change

The full hash appears twice in the spec dict now, replacing just
the value replaces it under "hash" and "full_hash".  Only replace
the one that appears after "full_hash".

I'm actually not sure what purpose this test served, so maybe it
could be removed, as it may be testing some distinction between
full and dag hash which no longer exists.
This commit is contained in:
Scott Wittenburg 2022-01-20 21:18:16 -07:00 committed by Todd Gamblin
parent e02020c80a
commit 32a2c22b2b

View file

@ -256,9 +256,11 @@ def test_hash_change(mock_test_stage, mock_packages, mock_archive, mock_fetch,
outfile = os.path.join(testdir, 'test_suite.lock') outfile = os.path.join(testdir, 'test_suite.lock')
with open(outfile, 'r') as f: with open(outfile, 'r') as f:
output = f.read() output = f.read()
val_replace = '"full_hash": "{0}"'.format(
spack.store.db.query('printing-package')[0].full_hash())
changed_hash = output.replace( changed_hash = output.replace(
spack.store.db.query('printing-package')[0].full_hash(), val_replace,
'fakehash492ucwhwvzhxfbmcc45x49ha') '"full_hash": "fakehash492ucwhwvzhxfbmcc45x49ha"')
with open(outfile, 'w') as f: with open(outfile, 'w') as f:
f.write(changed_hash) f.write(changed_hash)