summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--heatclient/common/template_utils.py2
-rw-r--r--heatclient/tests/test_common_http.py34
-rw-r--r--heatclient/tests/test_environment_format.py2
-rw-r--r--heatclient/tests/test_shell.py14
-rw-r--r--heatclient/tests/test_template_utils.py2
5 files changed, 27 insertions, 27 deletions
diff --git a/heatclient/common/template_utils.py b/heatclient/common/template_utils.py
index 7d077fa..bd54c9d 100644
--- a/heatclient/common/template_utils.py
+++ b/heatclient/common/template_utils.py
@@ -88,7 +88,7 @@ def process_environment_and_files(env_path=None, template_path=None):
env = {}
if not env_path:
- return files, None
+ return files, env
env_url = normalise_file_path_to_url(env_path)
env_base_url = base_url_for_url(env_url)
diff --git a/heatclient/tests/test_common_http.py b/heatclient/tests/test_common_http.py
index e3d86ba..e153cd2 100644
--- a/heatclient/tests/test_common_http.py
+++ b/heatclient/tests/test_common_http.py
@@ -46,8 +46,8 @@ class HttpClientTest(testtools.TestCase):
self.m.ReplayAll()
client = http.HTTPClient('http://example.com:8004')
resp, body = client.raw_request('GET', '')
- self.assertEqual(resp.status, 200)
- self.assertEqual(''.join([x for x in body]), '')
+ self.assertEqual(200, resp.status)
+ self.assertEqual('', ''.join([x for x in body]))
self.m.VerifyAll()
def test_token_or_credentials(self):
@@ -88,16 +88,16 @@ class HttpClientTest(testtools.TestCase):
self.m.ReplayAll()
client = http.HTTPClient('http://example.com:8004')
resp, body = client.raw_request('GET', '')
- self.assertEqual(resp.status, 200)
+ self.assertEqual(200, resp.status)
client.username = 'user'
client.password = 'pass'
resp, body = client.raw_request('GET', '')
- self.assertEqual(resp.status, 200)
+ self.assertEqual(200, resp.status)
client.auth_token = 'abcd1234'
resp, body = client.raw_request('GET', '')
- self.assertEqual(resp.status, 200)
+ self.assertEqual(200, resp.status)
self.m.VerifyAll()
def test_include_pass(self):
@@ -196,7 +196,7 @@ class HttpClientTest(testtools.TestCase):
client = http.HTTPClient('http://example.com:8004')
client.region_name = 'RegionOne'
resp, body = client.raw_request('GET', '')
- self.assertEqual(resp.status, 200)
+ self.assertEqual(200, resp.status)
self.m.VerifyAll()
def test_http_json_request(self):
@@ -216,8 +216,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, 200)
- self.assertEqual(body, {})
+ self.assertEqual(200, resp.status)
+ self.assertEqual({}, body)
self.m.VerifyAll()
def test_http_json_request_w_req_body(self):
@@ -237,8 +237,8 @@ class HttpClientTest(testtools.TestCase):
self.m.ReplayAll()
client = http.HTTPClient('http://example.com:8004')
resp, body = client.json_request('GET', '', body='test-body')
- self.assertEqual(resp.status, 200)
- self.assertEqual(body, {})
+ self.assertEqual(200, resp.status)
+ self.assertEqual({}, body)
self.m.VerifyAll()
def test_http_json_request_non_json_resp_cont_type(self):
@@ -258,7 +258,7 @@ class HttpClientTest(testtools.TestCase):
self.m.ReplayAll()
client = http.HTTPClient('http://example.com:8004')
resp, body = client.json_request('GET', '', body='test-body')
- self.assertEqual(resp.status, 200)
+ self.assertEqual(200, resp.status)
self.assertIsNone(body)
self.m.VerifyAll()
@@ -279,8 +279,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, 200)
- self.assertEqual(body, 'invalid-json')
+ self.assertEqual(200, resp.status)
+ self.assertEqual('invalid-json', body)
self.m.VerifyAll()
def test_http_json_request_redirect(self):
@@ -312,8 +312,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, 200)
- self.assertEqual(body, {})
+ self.assertEqual(200, resp.status)
+ self.assertEqual({}, body)
self.m.VerifyAll()
def test_http_json_request_prohibited_redirect(self):
@@ -399,8 +399,8 @@ class HttpClientTest(testtools.TestCase):
# cert_file='dummy',
# key_file='dummy')
# resp, body = client.json_request('GET', '')
- # self.assertEqual(resp.status, 200)
- # self.assertEqual(body, {})
+ # self.assertEqual(200, resp.status)
+ # self.assertEqual({}, body)
# self.m.VerifyAll()
def test_fake_json_request(self):
diff --git a/heatclient/tests/test_environment_format.py b/heatclient/tests/test_environment_format.py
index 0df52d1..8a1e6bf 100644
--- a/heatclient/tests/test_environment_format.py
+++ b/heatclient/tests/test_environment_format.py
@@ -34,7 +34,7 @@ resource_registry: {}
tpl1 = environment_format.parse(yaml1)
environment_format.default_for_missing(tpl1)
tpl2 = environment_format.parse(yaml2)
- self.assertEqual(tpl1, tpl2)
+ self.assertEqual(tpl2, tpl1)
def test_wrong_sections(self):
env = '''
diff --git a/heatclient/tests/test_shell.py b/heatclient/tests/test_shell.py
index 0fd5a31..c7acbab 100644
--- a/heatclient/tests/test_shell.py
+++ b/heatclient/tests/test_shell.py
@@ -246,7 +246,7 @@ class ShellBase(TestCase):
_shell.main(argstr.split())
except SystemExit:
exc_type, exc_value, exc_traceback = sys.exc_info()
- self.assertEqual(exc_value.code, 0)
+ self.assertEqual(0, exc_value.code)
finally:
out = sys.stdout.getvalue()
sys.stdout.close()
@@ -398,7 +398,7 @@ class ShellTestUserPass(ShellBase):
try:
self.shell("stack-show bad")
except exc.HTTPException as e:
- self.assertEqual(str(e), "ERROR: " + message)
+ self.assertEqual("ERROR: " + message, str(e))
def test_parsable_verbose(self):
message = "The Stack (bad) could not be found."
@@ -424,7 +424,7 @@ class ShellTestUserPass(ShellBase):
self.shell("stack-show bad")
except exc.HTTPException as e:
expect = 'ERROR: The Stack (bad) could not be found.\n<TRACEBACK>'
- self.assertEqual(str(e), expect)
+ self.assertEqual(expect, str(e))
def test_parsable_malformed_error(self):
invalid_json = "ERROR: {Invalid JSON Error."
@@ -435,7 +435,7 @@ class ShellTestUserPass(ShellBase):
try:
self.shell("stack-show bad")
except exc.HTTPException as e:
- self.assertEqual(str(e), "ERROR: " + invalid_json)
+ self.assertEqual("ERROR: " + invalid_json, str(e))
def test_parsable_malformed_error_missing_message(self):
missing_message = {
@@ -455,7 +455,7 @@ class ShellTestUserPass(ShellBase):
try:
self.shell("stack-show bad")
except exc.HTTPException as e:
- self.assertEqual(str(e), "ERROR: Internal Error")
+ self.assertEqual("ERROR: Internal Error", str(e))
def test_parsable_malformed_error_missing_traceback(self):
message = "The Stack (bad) could not be found."
@@ -478,8 +478,8 @@ class ShellTestUserPass(ShellBase):
try:
self.shell("stack-show bad")
except exc.HTTPException as e:
- self.assertEqual(str(e),
- "ERROR: The Stack (bad) could not be found.\n")
+ self.assertEqual("ERROR: The Stack (bad) could not be found.\n",
+ str(e))
def test_stack_show(self):
self._script_keystone_client()
diff --git a/heatclient/tests/test_template_utils.py b/heatclient/tests/test_template_utils.py
index d66b511..2b9b2ae 100644
--- a/heatclient/tests/test_template_utils.py
+++ b/heatclient/tests/test_template_utils.py
@@ -163,7 +163,7 @@ class ShellEnvironmentTest(testtools.TestCase):
def test_no_process_environment_and_files(self):
files, env = template_utils.process_environment_and_files()
- self.assertIsNone(env)
+ self.assertEqual({}, env)
self.assertEqual({}, files)
def test_global_files(self):