s4/linked_attribute tests: compare link lists in sorted order
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 11 Jan 2017 22:57:17 +0000 (11:57 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 9 Feb 2017 02:17:14 +0000 (03:17 +0100)
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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/tests/python/linked_attributes.py

index c16ab340c7b69dbf0c4e9e23330fb2e21bd4fcc0..4f65df998ac36af37de18c3b93f4b1bb8ea1608e 100644 (file)
@@ -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