From 1c959979af2b40b03bd7da6be8df672ccc32ec3d Mon Sep 17 00:00:00 2001 From: hardik Date: Sat, 19 Sep 2015 08:28:37 +0530 Subject: [PATCH] Added some tests for environment. Added some tests for environment-get, environment-update and environment-create. Change-Id: Ib027ebda4b6421f10eef297129bcf7c4e597191e --- .../tests/functional/cli/v2/cli_tests_v2.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mistralclient/tests/functional/cli/v2/cli_tests_v2.py b/mistralclient/tests/functional/cli/v2/cli_tests_v2.py index cccccf8c..c9515172 100644 --- a/mistralclient/tests/functional/cli/v2/cli_tests_v2.py +++ b/mistralclient/tests/functional/cli/v2/cli_tests_v2.py @@ -1118,6 +1118,12 @@ class NegativeCLITests(base_v2.MistralClientTestBase): self.mistral_admin, 'environment-get') + def test_env_get_nonexistent(self): + self.assertRaises(exceptions.CommandFailed, + self.mistral_admin, + 'environment-get', + params='nonexist') + def test_env_create_same_name(self): self.create_file('env.yaml', 'name: env\n' @@ -1130,6 +1136,12 @@ class NegativeCLITests(base_v2.MistralClientTestBase): self.environment_create, 'env.yaml') + def test_env_create_empty(self): + self.create_file('env.yaml') + self.assertRaises(exceptions.CommandFailed, + self.environment_create, + 'env.yaml') + def test_env_create_with_wrong_path_to_definition(self): self.assertRaises(exceptions.CommandFailed, self.mistral_admin, @@ -1148,6 +1160,13 @@ class NegativeCLITests(base_v2.MistralClientTestBase): 'environment-update', params='env') + def test_env_update_empty(self): + self.create_file('env.yaml') + self.assertRaises(exceptions.CommandFailed, + self.mistral_admin, + 'environment-update', + params='env') + def test_env_update_nonexistant_env(self): self.create_file('env.yaml', 'name: env'