def test_clean(self): with patch('lamvery.actions.base.Client') as c: c.get_targets_by_rule = Mock(return_value=[{ 'Id': 'foo', 'Arn': 'baz' }]) action = EventsAction(default_args()) action.get_client = Mock(return_value=c) action._clean(remote=[{ 'Name': 'bar' }], local=[{ 'rule': 'foo', 'targets': [] }, { 'rule': 'bar', 'targets': [] }], arn='baz', function='qux') action._clean(remote=[{ 'Name': 'bar' }], local=[{ 'rule': 'foo', 'targets': [] }], arn='baz', function='qux')
def test_clean(self): with patch("lamvery.actions.base.Client") as c: c.get_targets_by_rule = Mock(return_value=[{"Id": "foo", "Arn": "baz"}]) action = EventsAction(default_args()) action.get_client = Mock(return_value=c) action._clean( remote=[{"Name": "bar"}], local=[{"rule": "foo", "targets": []}, {"rule": "bar", "targets": []}], arn="baz", function="qux", ) action._clean(remote=[{"Name": "bar"}], local=[{"rule": "foo", "targets": []}], arn="baz", function="qux")
def test_clean(self): with patch('lamvery.actions.base.EventsClient') as c: c.get_targets_by_rule = Mock(return_value=[{'Id': 'foo', 'Arn': 'baz'}]) action = EventsAction(default_args()) action._get_client = Mock(return_value=c) action._clean( remote=[{'Name': 'bar'}], local=[{'rule': 'foo', 'targets': []}, {'rule': 'bar', 'targets': []}], arn='baz', function='qux') action._clean( remote=[{'Name': 'bar'}], local=[{'rule': 'foo', 'targets': []}], arn='baz', function='qux')
def test_action(self): with patch("lamvery.actions.base.Client") as c: c.get_function_conf = Mock(return_value={"FunctionArn": "foo"}) action = EventsAction(default_args()) action._put_rules = Mock() action._put_target = Mock() action._clean = Mock() action.get_client = Mock(return_value=c) action.action()
def test_action(self): with patch('lamvery.actions.base.Client') as c: c.get_function_conf = Mock(return_value={'FunctionArn': 'foo'}) action = EventsAction(default_args()) action._put_rules = Mock() action._put_target = Mock() action._clean = Mock() action.get_client = Mock(return_value=c) action.action()
def test_action(self): with patch('lamvery.actions.base.LambdaClient') as c: c.get_function_conf = Mock(return_value={'FunctionArn': 'foo'}) action = EventsAction(default_args()) action._put_rules = Mock() action._put_target = Mock() action._clean = Mock() action._get_client = Mock(return_value=c) action.action()