From e32fef50b614020823934874e73f18fe8e3ef6bd Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Barth Date: Tue, 3 Nov 2015 10:56:31 +0100 Subject: [PATCH] Fix random list ordering bugs on python 3.x in moto/swf tests --- tests/test_swf/models/test_domain.py | 4 ++-- tests/test_swf/models/test_generic_type.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_swf/models/test_domain.py b/tests/test_swf/models/test_domain.py index 0efa0029d..6430bc1ae 100644 --- a/tests/test_swf/models/test_domain.py +++ b/tests/test_swf/models/test_domain.py @@ -41,7 +41,7 @@ def test_domain_activity_tasks(): domain = Domain("my-domain", "60") domain.add_to_activity_task_list("foo", "bar") domain.add_to_activity_task_list("other", "baz") - domain.activity_tasks.should.equal(["bar", "baz"]) + sorted(domain.activity_tasks).should.equal(["bar", "baz"]) def test_domain_add_to_decision_task_list(): domain = Domain("my-domain", "60") @@ -54,7 +54,7 @@ def test_domain_decision_tasks(): domain = Domain("my-domain", "60") domain.add_to_decision_task_list("foo", "bar") domain.add_to_decision_task_list("other", "baz") - domain.decision_tasks.should.equal(["bar", "baz"]) + sorted(domain.decision_tasks).should.equal(["bar", "baz"]) def test_domain_get_workflow_execution(): domain = Domain("my-domain", "60") diff --git a/tests/test_swf/models/test_generic_type.py b/tests/test_swf/models/test_generic_type.py index 8937836e5..5d7f3d4d0 100644 --- a/tests/test_swf/models/test_generic_type.py +++ b/tests/test_swf/models/test_generic_type.py @@ -44,7 +44,8 @@ def test_type_full_dict_representation(): _type.to_full_dict()["configuration"]["justAnExampleTimeout"].should.equal("60") _type.non_whitelisted_property = "34" - _type.to_full_dict()["configuration"].keys().should.equal(["defaultTaskList", "justAnExampleTimeout"]) + keys = _type.to_full_dict()["configuration"].keys() + sorted(keys).should.equal(["defaultTaskList", "justAnExampleTimeout"]) def test_type_string_representation(): _type = FooType("test-foo", "v1.0")