How to use the crhelper.resource_helper function in crhelper

To help you get started, we’ve selected a few crhelper examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-cloudformation / custom-resource-helper / tests / test_resource_helper.py View on Github external
def test_init(self, mock_method):
        crhelper.resource_helper.CfnResource()
        mock_method.assert_called_once_with('DEBUG', boto_level='ERROR', formatter_cls=None)

        crhelper.resource_helper.CfnResource(json_logging=True)
        mock_method.assert_called_with('DEBUG', boto_level='ERROR', RequestType='ContainerInit')
github aws-cloudformation / custom-resource-helper / tests / test_resource_helper.py View on Github external
def test_polling_init(self):
        c = crhelper.resource_helper.CfnResource()
        event = test_events['Create']
        c._setup_polling = Mock()
        c._remove_polling = Mock()
        c._polling_init(event)
        c._setup_polling.assert_called_once()
        c._remove_polling.assert_not_called()
        self.assertEqual(c.PhysicalResourceId, None)

        c.Status = 'FAILED'
        c._setup_polling.assert_called_once()
        c._setup_polling.assert_called_once()

        c = crhelper.resource_helper.CfnResource()
        event = test_events['Create']
        c._setup_polling = Mock()
        c._remove_polling = Mock()
        event['CrHelperPoll'] = "Some stuff"
        c.PhysicalResourceId = None
        c._polling_init(event)
        c._remove_polling.assert_not_called()
        c._setup_polling.assert_not_called()

        c.Status = 'FAILED'
        c._polling_init(event)
        c._remove_polling.assert_called_once()
        c._setup_polling.assert_not_called()

        c.Status = ''
        c.PhysicalResourceId = "some-id"

crhelper

crhelper simplifies authoring CloudFormation Custom Resources

Apache-2.0
Latest version published 23 days ago

Package Health Score

84 / 100
Full package analysis

Similar packages