Fix periodic falling test
The method json.dumps() does not always return the same order of keys because in python dictionaries are unordered. This patch fixes this failing test by telling json.dumps to sort the response before returning. Change-Id: I13a4ce79cd4a8734094bef85ce0943fee25cbbc9
This commit is contained in:
parent
c6be32ec8d
commit
7881b819e3
@ -106,7 +106,7 @@ def lsn_port_create(cluster, lsn_id, port_data):
|
||||
return nsxlib.do_request(HTTP_POST,
|
||||
nsxlib._build_uri_path(LSERVICESNODEPORT_RESOURCE,
|
||||
parent_resource_id=lsn_id),
|
||||
jsonutils.dumps(port_obj),
|
||||
jsonutils.dumps(port_obj, sort_keys=True),
|
||||
cluster=cluster)["uuid"]
|
||||
|
||||
|
||||
|
@ -157,7 +157,7 @@ class LSNTestCase(base.BaseTestCase):
|
||||
}
|
||||
self.mock_request.assert_called_once_with(
|
||||
"POST", "/ws.v1/lservices-node/%s/lport" % lsn_id,
|
||||
jsonutils.dumps(port_obj), cluster=self.cluster)
|
||||
jsonutils.dumps(port_obj, sort_keys=True), cluster=self.cluster)
|
||||
|
||||
def test_lsn_port_delete(self):
|
||||
lsn_id = "foo_lsn_id"
|
||||
|
Loading…
Reference in New Issue
Block a user