Merge "Use correct order of arguments to assertEqual"

This commit is contained in:
Jenkins
2014-04-15 01:17:02 +00:00
committed by Gerrit Code Review
2 changed files with 9 additions and 9 deletions

View File

@@ -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')

View File

@@ -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: