From: Joseph Sutton Date: Thu, 2 Mar 2023 22:20:46 +0000 (+1300) Subject: tests/krb5: Allow comparing UnorderedLists only with one another X-Git-Tag: talloc-2.4.1~1475 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c6ff2ad07d71c79bb3564428c9751f2ce2a5451;p=thirdparty%2Fsamba.git tests/krb5: Allow comparing UnorderedLists only with one another Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/krb5/claims_tests.py b/python/samba/tests/krb5/claims_tests.py index eb305bbf0cd..b9f7af3df5b 100755 --- a/python/samba/tests/krb5/claims_tests.py +++ b/python/samba/tests/krb5/claims_tests.py @@ -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):