summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorWang Muyu <muyu@unitedstack.com>2015-08-16 11:21:24 -0400
committerWang Muyu <muyu@unitedstack.com>2015-08-19 10:52:08 -0400
commitb070ed0286206fcde36df5e0da39a227e2dfdb38 (patch)
tree62abe24ae7cb89df3a0f9a94fd0d00536c90b250 /contrib
parent87e625e20c1d30fa5844c0f7587c3983da0bb882 (diff)
downloadheat-b070ed0286206fcde36df5e0da39a227e2dfdb38.tar.gz
Improve unit tests to succeed without hash tweak
PYTHONHASHSEED was set to 0 to disable hash randomization, because some tests assertions were order sensitive. This commit is to improve the assertions, so the PYTHONHASHSEED hack in tox.ini is not needed. Change-Id: I4ff09d202af818d27321e8e83718e82d0c48e3d2 Closes-Bug: 1348818
Diffstat (limited to 'contrib')
-rw-r--r--contrib/rackspace/rackspace/tests/test_cloud_loadbalancer.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/contrib/rackspace/rackspace/tests/test_cloud_loadbalancer.py b/contrib/rackspace/rackspace/tests/test_cloud_loadbalancer.py
index 8c60a6c09..cb2be9033 100644
--- a/contrib/rackspace/rackspace/tests/test_cloud_loadbalancer.py
+++ b/contrib/rackspace/rackspace/tests/test_cloud_loadbalancer.py
@@ -17,6 +17,7 @@ import json
import uuid
import mock
+import mox
import six
from heat.common import exception
@@ -1229,11 +1230,11 @@ class LoadBalancerTest(common.HeatTestCase):
template['Resources'][lb_name]['Properties']['metadata'] = {
'a': 1, 'b': 2}
expected_body = copy.deepcopy(self.expected_body)
- expected_body['metadata'] = [{'key': 'a', 'value': 1},
- {'key': 'b', 'value': 2}]
- rsrc, fake_loadbalancer = self._mock_loadbalancer(template,
- self.lb_name,
- expected_body)
+ expected_body['metadata'] = mox.SameElementsAs(
+ [{'key': 'a', 'value': 1},
+ {'key': 'b', 'value': 2}])
+ rsrc, fake_loadbalancer = self._mock_loadbalancer(
+ template, self.lb_name, expected_body)
self.m.ReplayAll()
scheduler.TaskRunner(rsrc.create)()