From a76f24d70bbcfee34888bd09ebb508db3e94871e Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 18 Jun 2026 14:48:02 +0200 Subject: [PATCH] support/testing: test_gnupg2.py: use assertRunNotOk() Use the helper to simplify the test. Signed-off-by: Peter Korsgaard (cherry picked from commit cb791850ada782beca4b03e26356fd8506912d52) Signed-off-by: Thomas Perale --- support/testing/tests/package/test_gnupg2.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/support/testing/tests/package/test_gnupg2.py b/support/testing/tests/package/test_gnupg2.py index 2b18f54fa3..6f862c31ce 100644 --- a/support/testing/tests/package/test_gnupg2.py +++ b/support/testing/tests/package/test_gnupg2.py @@ -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)