Browse Source

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
tags/0.2.0
Dougal Matthews 9 months ago
parent
commit
b63d95a524
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      mistral_tempest_tests/tests/api/v2/test_actions.py

+ 2
- 1
mistral_tempest_tests/tests/api/v2/test_actions.py View File

@@ -165,10 +165,11 @@ class ActionTestsV2(base.TestCase):
165 165
         _, body = self.client.get_object('actions', created_acts[0])
166 166
         time = body['created_at']
167 167
         resp, body = self.client.get_list_obj(
168
-            'actions?created_at=in:' + time.replace(' ', '%20'))
168
+            'actions?sort_keys=name&created_at=in:' + time.replace(' ', '%20'))
169 169
 
170 170
         self.assertEqual(200, resp.status)
171 171
         action_names = [action['name'] for action in body['actions']]
172
+        created_acts.sort()
172 173
         self.assertListEqual(created_acts, action_names)
173 174
 
174 175
     @decorators.attr(type='smoke')

Loading…
Cancel
Save