From b63d95a5249aed3d98b43bf8bb38138d47738b0e Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Tue, 13 Nov 2018 09:29:10 +0000 Subject: [PATCH] Add sorting to the "in list filter" test Without this change, the result can be accurate but in the wrong order, causing a failure like: AssertionError: Lists differ: ['greeting', 'farewell'] != ['farewell', 'greeting'] Change-Id: Ia0f3e9fa03834feb4c87c6ac50930a0d533a19bd --- mistral_tempest_tests/tests/api/v2/test_actions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mistral_tempest_tests/tests/api/v2/test_actions.py b/mistral_tempest_tests/tests/api/v2/test_actions.py index 0ee35df..3f21d1f 100644 --- a/mistral_tempest_tests/tests/api/v2/test_actions.py +++ b/mistral_tempest_tests/tests/api/v2/test_actions.py @@ -165,10 +165,11 @@ class ActionTestsV2(base.TestCase): _, body = self.client.get_object('actions', created_acts[0]) time = body['created_at'] resp, body = self.client.get_list_obj( - 'actions?created_at=in:' + time.replace(' ', '%20')) + 'actions?sort_keys=name&created_at=in:' + time.replace(' ', '%20')) self.assertEqual(200, resp.status) action_names = [action['name'] for action in body['actions']] + created_acts.sort() self.assertListEqual(created_acts, action_names) @decorators.attr(type='smoke')