Fix intermittent test failures because of sort order
Both py27 and py34 jobs fail intermittently and i can recreate the problem even in my local environment by repeatedly running "tox -e py27,py34". Fixing up the sort order helps fix the this issue. Change-Id: I680c8e986af9177c759740ecb8b94b288386c1bf
This commit is contained in:
parent
6bfdb33cc9
commit
7a6ccda607
@ -38,7 +38,7 @@ class BasicKeyValueView(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __call__(self, model):
|
def __call__(self, model):
|
||||||
res = utils.StringWithAttrs(json.dumps(model.data))
|
res = utils.StringWithAttrs(json.dumps(model.data, sort_keys=True))
|
||||||
res.__is_json__ = True
|
res.__is_json__ = True
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class MultiView(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __call__(self, model):
|
def __call__(self, model):
|
||||||
res = [six.text_type(model[key]) for key in model]
|
res = sorted([six.text_type(model[key]) for key in model])
|
||||||
return "\n".join(res)
|
return "\n".join(res)
|
||||||
|
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class BasicKeyValueView(object):
|
|||||||
|
|
||||||
def __call__(self, model):
|
def __call__(self, model):
|
||||||
res = ""
|
res = ""
|
||||||
for key in model:
|
for key in sorted(model):
|
||||||
res += "{key} = {value}\n".format(key=key, value=model[key])
|
res += "{key} = {value}\n".format(key=key, value=model[key])
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
Loading…
Reference in New Issue
Block a user