Test: Fix assert_has_calls dict order bug (QoS)

assert_has_calls assumes that calls come in a
particular order by default, but the order here
is not actually predictable.

This test will currently fail if Python hash
seed randomization is enabled.

Change-Id: I0bba326b88ba97f17ec1824c4d6ea78110ff5954
This commit is contained in:
Eric Harney 2017-01-23 10:58:28 -05:00
parent e79f5f702c
commit fabee55828
1 changed files with 2 additions and 1 deletions

View File

@ -78,7 +78,8 @@ class TestQos(test_objects.BaseObjectsTestCase):
'consumer': 'back-end'})
qos_fake_delete.assert_has_calls([
mock.call(self.context, fake.OBJECT_ID, 'key_to_remove1'),
mock.call(self.context, fake.OBJECT_ID, 'key_to_remove2')])
mock.call(self.context, fake.OBJECT_ID, 'key_to_remove2')],
any_order=True)
@mock.patch('oslo_utils.timeutils.utcnow', return_value=timeutils.utcnow())
@mock.patch('cinder.objects.VolumeTypeList.get_all_types_for_qos',