support/testing: test_gnupg2.py: use assertRunNotOk()

Use the helper to simplify the test.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit cb791850ad)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
Peter Korsgaard
2026-06-18 14:48:02 +02:00
committed by Thomas Perale
parent 0a0e108a58
commit a76f24d70b

View File

@@ -49,8 +49,7 @@ class TestGnupg2(infra.basetest.BRTest):
# Test a failed decrypt with a bad password
cmd = "gpg --batch --decrypt"
cmd += " --passphrase 'A-Bad-Password' {}".format(gpg_file)
_, exit_code = self.emulator.run(cmd)
self.assertNotEqual(exit_code, 0)
self.assertRunNotOk(cmd)
# Test the generation of an asymmetric key
cmd = "gpg --batch --passphrase ''"
@@ -106,9 +105,7 @@ class TestGnupg2(infra.basetest.BRTest):
self.assertRunOk(cmd)
cmd = "gpg --verify {}".format(sig_file)
_, exit_code = self.emulator.run(cmd)
self.assertNotEqual(exit_code, 0)
self.assertRunNotOk(cmd)
cmd = "gpg --armor --verify {}".format(asc_file)
_, exit_code = self.emulator.run(cmd)
self.assertNotEqual(exit_code, 0)
self.assertRunNotOK(cmd)