summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavlo Shchelokovskyy <pshchelokovskyy@mirantis.com>2014-03-24 14:58:47 +0200
committerPavlo Shchelokovskyy <pshchelokovskyy@mirantis.com>2014-04-14 12:54:17 +0300
commite07e9d936665d4c7e58edc30e2746544ce4fa784 (patch)
tree4bfd6f774a1462662951416be2d52b1aa98443b8
parent7a85f8ba8a07333f5070c0d1bd8173e6ea50493b (diff)
downloadpython-heatclient-e07e9d936665d4c7e58edc30e2746544ce4fa784.tar.gz
Use correct order of arguments to assertEqual
The correct order of arguments to assertEqual that is expected by testtools is (expected, observed). This patch fixes the inverted usage of arguments in some places that have cropped up since the last fix of this bug. Change-Id: Ifbc5da5cba0c8dcdf5b9c9eb6e6bfb1b1c2b49b0 Closes-Bug: #1259292
-rw-r--r--heatclient/tests/test_common_http.py10
-rw-r--r--heatclient/tests/test_template_utils.py8
2 files changed, 9 insertions, 9 deletions
diff --git a/heatclient/tests/test_common_http.py b/heatclient/tests/test_common_http.py
index 301b665..a2b4b50 100644
--- a/heatclient/tests/test_common_http.py
+++ b/heatclient/tests/test_common_http.py
@@ -480,8 +480,8 @@ class HttpClientTest(testtools.TestCase):
self.m.ReplayAll()
client = http.HTTPClient('http://example.com:8004')
resp, body = client.json_request('GET', '')
- self.assertEqual(resp.status_code, 200)
- self.assertEqual(body, {})
+ self.assertEqual(200, resp.status_code)
+ self.assertEqual({}, body)
self.m.VerifyAll()
def test_http_404_json_request(self):
@@ -617,7 +617,7 @@ class HttpClientTest(testtools.TestCase):
self.m.ReplayAll()
ca = http.get_system_ca_file()
- self.assertEqual(ca, chosen)
+ self.assertEqual(chosen, ca)
self.m.VerifyAll()
@@ -627,13 +627,13 @@ class HttpClientTest(testtools.TestCase):
def test_passed_cert_to_verify_cert(self):
client = http.HTTPClient('https://foo', ca_file="NOWHERE")
- self.assertEqual(client.verify_cert, "NOWHERE")
+ self.assertEqual("NOWHERE", client.verify_cert)
self.m.StubOutWithMock(http, 'get_system_ca_file')
http.get_system_ca_file().AndReturn("SOMEWHERE")
self.m.ReplayAll()
client = http.HTTPClient('https://foo')
- self.assertEqual(client.verify_cert, "SOMEWHERE")
+ self.assertEqual("SOMEWHERE", client.verify_cert)
def test_curl_log_i18n_headers(self):
self.m.StubOutWithMock(logging.Logger, 'debug')
diff --git a/heatclient/tests/test_template_utils.py b/heatclient/tests/test_template_utils.py
index 951dcad..bd10db0 100644
--- a/heatclient/tests/test_template_utils.py
+++ b/heatclient/tests/test_template_utils.py
@@ -293,17 +293,17 @@ class TestGetTemplateContents(testtools.TestCase):
template_utils.get_template_contents,
tmpl_file.name)
self.assertEqual(
- str(ex),
- 'Could not fetch template from file://%s' % tmpl_file.name)
+ 'Could not fetch template from file://%s' % tmpl_file.name,
+ str(ex))
def test_get_template_contents_file_none(self):
ex = self.assertRaises(
exc.CommandError,
template_utils.get_template_contents)
self.assertEqual(
- str(ex),
('Need to specify exactly one of --template-file, '
- '--template-url or --template-object'))
+ '--template-url or --template-object'),
+ str(ex))
def test_get_template_contents_parse_error(self):
with tempfile.NamedTemporaryFile() as tmpl_file: