From 5682df15a098dcad7398d8dafdcbccac37371c1a Mon Sep 17 00:00:00 2001 From: Jo Sutton Date: Wed, 24 Apr 2024 13:38:53 +1200 Subject: [PATCH] python:tests: Manually raise AssertionError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes the last dependency on ‘self’ in this method. Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- python/samba/tests/dckeytab.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/samba/tests/dckeytab.py b/python/samba/tests/dckeytab.py index 045a9effdfc..0853d109619 100644 --- a/python/samba/tests/dckeytab.py +++ b/python/samba/tests/dckeytab.py @@ -71,7 +71,8 @@ class DCKeytabTests(TestCaseInTempDir): multiple_entry = ndr_unpack(krb5ccache.MULTIPLE_KEYTAB_ENTRIES, keytab_bytes) entry = multiple_entry.entry entry_as_tuple = entry_to_tuple(entry) - self.assertNotIn(entry_as_tuple, keytab_set) + if entry_as_tuple in keytab_set: + raise AssertionError('entry found multiple times in keytab') keytab_set.add(entry_as_tuple) keytab_bytes = multiple_entry.further_entry