summaryrefslogtreecommitdiff
path: root/heat/tests/api/aws/test_api_ec2token.py
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 /heat/tests/api/aws/test_api_ec2token.py
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 'heat/tests/api/aws/test_api_ec2token.py')
-rw-r--r--heat/tests/api/aws/test_api_ec2token.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/heat/tests/api/aws/test_api_ec2token.py b/heat/tests/api/aws/test_api_ec2token.py
index ffcda3d3d..dae129b53 100644
--- a/heat/tests/api/aws/test_api_ec2token.py
+++ b/heat/tests/api/aws/test_api_ec2token.py
@@ -24,12 +24,13 @@ from heat.api.aws import ec2token
from heat.api.aws import exception
from heat.common import wsgi
from heat.tests import common
+from heat.tests import utils
class Ec2TokenTest(common.HeatTestCase):
- '''
+ """
Tests the Ec2Token middleware
- '''
+ """
def setUp(self):
super(Ec2TokenTest, self).setUp()
@@ -253,8 +254,9 @@ class Ec2TokenTest(common.HeatTestCase):
"path": "/v1",
"body_hash": body_hash}})
req_headers = {'Content-Type': 'application/json'}
- requests.post(req_url, data=req_creds, verify=verify, cert=cert,
- headers=req_headers).AndReturn(DummyHTTPResponse())
+ requests.post(
+ req_url, data=utils.JsonEquals(req_creds), verify=verify,
+ cert=cert, headers=req_headers).AndReturn(DummyHTTPResponse())
def test_call_ok(self):
dummy_conf = {'auth_uri': 'http://123:5000/v2.0'}