]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Allow comparing UnorderedLists only with one another
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 2 Mar 2023 22:20:46 +0000 (11:20 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 8 Mar 2023 04:39:32 +0000 (04:39 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/krb5/claims_tests.py

index eb305bbf0cd4764482fecc00c4adfb54752c71ae..b9f7af3df5bcb544e93d63654e6ba1fbd6107988 100755 (executable)
@@ -47,11 +47,9 @@ global_hexdump = False
 
 class UnorderedList(list):
     def __eq__(self, other):
-        if isinstance(other, UnorderedList):
-            return sorted(self) == sorted(other)
-        else:
-            return False
-
+        if not isinstance(other, UnorderedList):
+            raise AssertionError('unexpected comparison attempt')
+        return sorted(self) == sorted(other)
 
 @DynamicTestCase
 class ClaimsTests(KDCBaseTest):