Fixing dict ordering issue in task tests
* Whenever we compare two string representations of the same dict we should keep in mind that they may be different since standard dict doesn't provide ordering guarantees. * Modified AUTHORS Change-Id: I61badaff81b03aa001633d85ecafe846409b72a3
This commit is contained in:
parent
a44495d516
commit
b5628439f9
7
AUTHORS
7
AUTHORS
@ -3,15 +3,20 @@ Angus Salkeld <angus.salkeld@rackspace.com>
|
||||
Christian Berendt <berendt@b1-systems.de>
|
||||
David C Kennedy <David C Kennedy>
|
||||
Dmitri Zimine <dz@stackstorm.com>
|
||||
Ed Cranford <ed.cranford@rackspace.com>
|
||||
Jeremy Stanley <fungi@yuggoth.org>
|
||||
Kevin Zheng <zhengzhenyu@huawei.com>
|
||||
Kirill Izotov <enykeev@stackstorm.com>
|
||||
Leandro I. Costantino <leandro.i.costantino@intel.com>
|
||||
Limor Stotland <limor.bortman@alcatel-lucent.com>
|
||||
Lingxian Kong <konglingxian@huawei.com>
|
||||
Nikolay Mahotkin <nmakhotkin@mirantis.com>
|
||||
Pierre-Arthur MATHIEU <pierre-arthur.mathieu@hp.com>
|
||||
Renat Akhmerov <rakhmerov@mirantis.com>
|
||||
Robert Collins <rbtcollins@hp.com>
|
||||
Sirushti Murugesan <sirushti.murugesan@hp.com>
|
||||
Tetiana Lashchova <tlashchova@mirantis.com>
|
||||
Thomas Goirand <zigo@debian.org>
|
||||
Timur Nurlygayanov <tnurlygayanov@mirantis.com>
|
||||
Winson Chan <wcchan@stackstorm.com>
|
||||
|
||||
Zhenguo Niu <niuzhenguo@huawei.com>
|
||||
|
@ -58,8 +58,7 @@ class TestTasksV2(base.BaseClientV2Test):
|
||||
tasks.Task(self.tasks, TASK).to_dict(),
|
||||
task.to_dict()
|
||||
)
|
||||
mock.assert_called_once_with(
|
||||
URL_TEMPLATE_ID % TASK['id'])
|
||||
mock.assert_called_once_with(URL_TEMPLATE_ID % TASK['id'])
|
||||
|
||||
def test_rerun(self):
|
||||
mock = self.mock_http_put(content=TASK)
|
||||
@ -71,9 +70,15 @@ class TestTasksV2(base.BaseClientV2Test):
|
||||
task.to_dict()
|
||||
)
|
||||
|
||||
mock.assert_called_once_with(
|
||||
URL_TEMPLATE_ID % TASK['id'],
|
||||
json.dumps({'reset': True, 'state': 'RUNNING', 'id': TASK['id']})
|
||||
self.assertEqual(1, mock.call_count)
|
||||
self.assertEqual(URL_TEMPLATE_ID % TASK['id'], mock.call_args[0][0])
|
||||
self.assertDictEqual(
|
||||
{
|
||||
'reset': True,
|
||||
'state': 'RUNNING',
|
||||
'id': TASK['id']
|
||||
},
|
||||
json.loads(mock.call_args[0][1])
|
||||
)
|
||||
|
||||
def test_rerun_no_reset(self):
|
||||
@ -86,7 +91,13 @@ class TestTasksV2(base.BaseClientV2Test):
|
||||
task.to_dict()
|
||||
)
|
||||
|
||||
mock.assert_called_once_with(
|
||||
URL_TEMPLATE_ID % TASK['id'],
|
||||
json.dumps({'reset': False, 'state': 'RUNNING', 'id': TASK['id']})
|
||||
self.assertEqual(1, mock.call_count)
|
||||
self.assertEqual(URL_TEMPLATE_ID % TASK['id'], mock.call_args[0][0])
|
||||
self.assertDictEqual(
|
||||
{
|
||||
'reset': False,
|
||||
'state': 'RUNNING',
|
||||
'id': TASK['id']
|
||||
},
|
||||
json.loads(mock.call_args[0][1])
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user