def test_get_version_target_not_exists(self): c = Mock() c.get_alias = Mock(return_value={}) args = default_args() args.target = 'foo' action = SetAliasAction(args) action.get_lambda_client = Mock(return_value=c) action.get_version('foo')
def test_get_version_target_not_exists(self): c = Mock() c.get_alias = Mock(return_value={}) args = default_args() args.target = 'foo' action = SetAliasAction(args) action.get_lambda_client = Mock(return_value=c) action.get_version('foo')
def test_get_version(self): action = SetAliasAction(default_args()) eq_(action.get_version('foo'), '$LATEST') args = default_args() args.version = '1' action = SetAliasAction(args) eq_(action.get_version('foo'), '1') c = Mock() c.get_alias = Mock(return_value={'FunctionVersion': '2'}) args = default_args() args.target = 'foo' action = SetAliasAction(args) action.get_lambda_client = Mock(return_value=c) eq_(action.get_version('foo'), '2')
def test_get_version(self): action = SetAliasAction(default_args()) eq_(action.get_version('foo'), '$LATEST') args = default_args() args.version = '1' action = SetAliasAction(args) eq_(action.get_version('foo'), '1') c = Mock() c.get_alias = Mock(return_value={'FunctionVersion': '2'}) args = default_args() args.target = 'foo' action = SetAliasAction(args) action.get_lambda_client = Mock(return_value=c) eq_(action.get_version('foo'), '2')