From: Jo Sutton Date: Wed, 24 Apr 2024 01:38:53 +0000 (+1200) Subject: python:tests: Manually raise AssertionError X-Git-Tag: tdb-1.4.11~581 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5682df15a098dcad7398d8dafdcbccac37371c1a;p=thirdparty%2Fsamba.git python:tests: Manually raise AssertionError This removes the last dependency on ‘self’ in this method. Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- 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