summaryrefslogtreecommitdiffstats
path: root/tests/util.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-08-30 23:40:17 -0400
committerMartin Kosek <mkosek@redhat.com>2011-08-31 11:18:08 +0200
commit8f5e82940fd2f5a81fe3644686b06ec08fb22c58 (patch)
treeac7cb81968f51a31f8e9d84342a5f59faf1b3400 /tests/util.py
parentd05ace8fba6ea4a61c1070d5e5687aaa5d2aee2b (diff)
downloadfreeipa-8f5e82940fd2f5a81fe3644686b06ec08fb22c58.tar.gz
freeipa-8f5e82940fd2f5a81fe3644686b06ec08fb22c58.tar.xz
freeipa-8f5e82940fd2f5a81fe3644686b06ec08fb22c58.zip
Sort lists so order is predictable and tests pass as expected.
Related to https://fedorahosted.org/freeipa/ticket/1272
Diffstat (limited to 'tests/util.py')
-rw-r--r--tests/util.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/util.py b/tests/util.py
index 48260dd7c..5a365fbcd 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -286,7 +286,7 @@ def assert_deepequal(expected, got, doc='', stack=tuple()):
type(got) = <type 'str'>
expected = u'how are you?'
got = 'how are you?'
- path = (1, 'world')
+ path = (0, 'world')
"""
if isinstance(expected, tuple):
expected = list(expected)
@@ -301,8 +301,10 @@ def assert_deepequal(expected, got, doc='', stack=tuple()):
raise AssertionError(
LEN % (doc, len(expected), len(got), expected, got, stack)
)
- for (i, e_sub) in enumerate(expected):
- g_sub = got[i]
+ s_got = sorted(got)
+ s_expected = sorted(expected)
+ for (i, e_sub) in enumerate(s_expected):
+ g_sub = s_got[i]
assert_deepequal(e_sub, g_sub, doc, stack + (i,))
elif isinstance(expected, dict):
missing = set(expected).difference(got)