summaryrefslogtreecommitdiff
path: root/heat/tests/test_parameters.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-09-13 03:35:14 +0000
committerGerrit Code Review <review@openstack.org>2014-09-13 03:35:14 +0000
commit38aa12a015379bc7c10da3411dac40870344fe70 (patch)
treef6623d7b1a5b17e2314454bf6b0afdfb6b38e189 /heat/tests/test_parameters.py
parent0485d4d4c269414a0d95bbc78732f4213570c507 (diff)
parent391365852740f8312347b326cb8b53720c3df03e (diff)
downloadheat-38aa12a015379bc7c10da3411dac40870344fe70.tar.gz
Merge "Make str(json_param) return string vs python"
Diffstat (limited to 'heat/tests/test_parameters.py')
-rw-r--r--heat/tests/test_parameters.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/heat/tests/test_parameters.py b/heat/tests/test_parameters.py
index 0856415fa..ef0885563 100644
--- a/heat/tests/test_parameters.py
+++ b/heat/tests/test_parameters.py
@@ -50,6 +50,16 @@ class ParameterTest(testtools.TestCase):
p = self.new_parameter('p', {'Type': 'Json'}, validate_value=False)
self.assertIsInstance(p, parameters.JsonParam)
+ def test_json_return(self):
+ p = self.new_parameter('p', {'Type': 'Json'}, {"a": 1, "b": "a"})
+ self.assertEqual('{"a": 1, "b": "a"}', str(p))
+
+ def test_json_return_no_echo_true(self):
+ p = self.new_parameter(
+ 'p', {'Type': 'Json', 'NoEcho': 'true'}, {"a": 1})
+ self.assertTrue(p.hidden())
+ self.assertEqual(str(p), '******')
+
def test_new_bad_type(self):
self.assertRaises(exception.InvalidSchemaError, self.new_parameter,
'p', {'Type': 'List'}, validate_value=False)