From: Douglas Bagnall Date: Wed, 11 Jan 2017 22:57:17 +0000 (+1300) Subject: s4/linked_attribute tests: compare link lists in sorted order X-Git-Tag: talloc-2.1.9~257 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bee3faadd5c07ef81cd158d8c07990f6ee73873;p=thirdparty%2Fsamba.git s4/linked_attribute tests: compare link lists in sorted order This isn't functionally different[1] from the previous use of set(), but it makes the error output easier to read. [1] OK, it will also show duplicates, which we really don't expect and would definitely want to see. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/tests/python/linked_attributes.py b/source4/dsdb/tests/python/linked_attributes.py index c16ab340c7b..4f65df998ac 100644 --- a/source4/dsdb/tests/python/linked_attributes.py +++ b/source4/dsdb/tests/python/linked_attributes.py @@ -127,8 +127,7 @@ class LATests(samba.tests.TestCase): controls=controls) return res - def assert_links(self, obj, expected, attr, sorted=False, msg='', - **kwargs): + def assert_links(self, obj, expected, attr, msg='', **kwargs): res = self.attr_search(obj, expected, attr, **kwargs) if len(expected) == 0: @@ -141,9 +140,8 @@ class LATests(samba.tests.TestCase): except KeyError: self.fail("missing attr '%s' on %s" % (attr, obj)) - if sorted == False: - results = set(results) - expected = set(expected) + expected = sorted(expected) + results = sorted(results) if expected != results: print msg