diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-09-13 03:35:14 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-09-13 03:35:14 +0000 |
commit | 38aa12a015379bc7c10da3411dac40870344fe70 (patch) | |
tree | f6623d7b1a5b17e2314454bf6b0afdfb6b38e189 /heat/tests/test_parameters.py | |
parent | 0485d4d4c269414a0d95bbc78732f4213570c507 (diff) | |
parent | 391365852740f8312347b326cb8b53720c3df03e (diff) | |
download | heat-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.py | 10 |
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) |