本文整理匯總了Python中cfn_sphere.stack_configuration.parameter_resolver.ParameterResolver.get_latest_value方法的典型用法代碼示例。如果您正苦於以下問題:Python ParameterResolver.get_latest_value方法的具體用法?Python ParameterResolver.get_latest_value怎麽用?Python ParameterResolver.get_latest_value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cfn_sphere.stack_configuration.parameter_resolver.ParameterResolver
的用法示例。
在下文中一共展示了ParameterResolver.get_latest_value方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_get_latest_value_returns_default_value
# 需要導入模塊: from cfn_sphere.stack_configuration.parameter_resolver import ParameterResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.parameter_resolver.ParameterResolver import get_latest_value [as 別名]
def test_get_latest_value_returns_default_value(self):
self.cfn_mock.return_value.get_stack_parameters_dict.side_effect = CfnSphereBotoError(
BotoServerError("500", "foo")
)
resolver = ParameterResolver()
with self.assertRaises(CfnSphereException):
resolver.get_latest_value("my-key", "|keepOrUse|default-value", "my-stack")
示例2: test_get_latest_value_returns_default_value_called_once_with_stack
# 需要導入模塊: from cfn_sphere.stack_configuration.parameter_resolver import ParameterResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.parameter_resolver.ParameterResolver import get_latest_value [as 別名]
def test_get_latest_value_returns_default_value_called_once_with_stack(self):
self.cfn_mock.return_value.get_stack_parameters_dict.return_value = {'not-my-key': 'my-actual-value'}
pr = ParameterResolver()
result = pr.get_latest_value('my-key', '|keepOrUse|default-value', 'my-stack')
self.cfn_mock.return_value.get_stack_parameters_dict.assert_called_once_with('my-stack')
self.assertEqual('default-value', result)
示例3: test_get_latest_value_returns_stacks_actual_value
# 需要導入模塊: from cfn_sphere.stack_configuration.parameter_resolver import ParameterResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.parameter_resolver.ParameterResolver import get_latest_value [as 別名]
def test_get_latest_value_returns_stacks_actual_value(self, kms, ec2_api, cfn_mock):
cfn_mock.return_value.get_stack_parameters_dict.return_value = {'my-key': 'my-actual-value'}
pr = ParameterResolver()
result = pr.get_latest_value('my-key', '|keepOrUse|default-value', 'my-stack')
cfn_mock.return_value.get_stack_parameters_dict.assert_called_once_with('my-stack')
self.assertEqual('my-actual-value', result)
示例4: test_get_latest_value_raises_exception_on_error
# 需要導入模塊: from cfn_sphere.stack_configuration.parameter_resolver import ParameterResolver [as 別名]
# 或者: from cfn_sphere.stack_configuration.parameter_resolver.ParameterResolver import get_latest_value [as 別名]
def test_get_latest_value_raises_exception_on_error(self):
self.cfn_mock.return_value.get_stack_parameters_dict.side_effect = CfnSphereBotoError(Exception("foo"))
resolver = ParameterResolver()
with self.assertRaises(CfnSphereException):
resolver.get_latest_value('my-key', '|keepOrUse|default-value', 'my-stack')