From 407e28d0d29b1707b9d1cc0813f89c8d6860ff13 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Thu, 18 Jun 2026 14:48:07 +0200 Subject: [PATCH] support/testing: test_libgpgme.py: use assertRunNotOk() Use the helper to simplify the test. Signed-off-by: Peter Korsgaard (cherry picked from commit a0b5a634f01acb6ebf402e61dfc02c8a03eba221) Signed-off-by: Thomas Perale --- support/testing/tests/package/test_libgpgme.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/support/testing/tests/package/test_libgpgme.py b/support/testing/tests/package/test_libgpgme.py index b497891249..5d0ee34aa6 100644 --- a/support/testing/tests/package/test_libgpgme.py +++ b/support/testing/tests/package/test_libgpgme.py @@ -31,8 +31,7 @@ class TestLibGpgme(infra.basetest.BRTest): # We did not create a gpg key yet. We should not be able to # list our key. gpgme_listkey = f"echo LISTKEYS | gpgme-tool | grep '{gpg_userid}'" - _, exit_code = self.emulator.run(gpgme_listkey) - self.assertNotEqual(exit_code, 0) + self.assertRunNotOk(gpgme_listkey) # We now create our gpg key. cmd = "gpg --batch --passphrase ''" @@ -66,8 +65,7 @@ class TestLibGpgme(infra.basetest.BRTest): # The output encrypted file is also expected to be different # from the input plain text file. - _, exit_code = self.emulator.run(f"cmp {plain_file} {enc_file}") - self.assertNotEqual(exit_code, 0) + self.assertRunNotOk(f"cmp {plain_file} {enc_file}") # We now decrypt the encrypted file using gpgme-tool commands. gpgme_dec_cmds = [