本文整理汇总了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')