]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:tests: Manually raise AssertionError
authorJo Sutton <josutton@catalyst.net.nz>
Wed, 24 Apr 2024 01:38:53 +0000 (13:38 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 May 2024 20:33:36 +0000 (20:33 +0000)
This removes the last dependency on ‘self’ in this method.

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/dckeytab.py

index 045a9effdfc8318e5885c4530af7c01bfb697e6c..0853d1096191e446d4e425ebd087328afcc2e159 100644 (file)
@@ -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