How to use the crhelper.utils 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_utils.py View on Github external
def test_send_succeeded_response(self, https_connection_mock):
        utils._send_response(self.TEST_URL, {})
        https_connection_mock.assert_called_once_with("test_url")
        https_connection_mock.return_value.request.assert_called_once_with(
            body='{}',
            headers={"content-type": "", "content-length": "2"},
            method="PUT",
            url="/this/is/the/url?query=123#aaa",
        )
github aws-cloudformation / custom-resource-helper / tests / test_utils.py View on Github external
def test_send_failed_response(self, https_connection_mock):
        utils._send_response(self.TEST_URL, Mock())
        https_connection_mock.assert_called_once_with("test_url")
        response = json.loads(https_connection_mock.return_value.request.call_args[1]["body"])
        expected_body = '{"Status": "FAILED", "Data": {}, "Reason": "' + response["Reason"] + '"}'
        https_connection_mock.return_value.request.assert_called_once_with(
            body=expected_body,
            headers={"content-type": "", "content-length": str(len(expected_body))},
            method="PUT",
            url="/this/is/the/url?query=123#aaa",
        )

crhelper

crhelper simplifies authoring CloudFormation Custom Resources

Apache-2.0
Latest version published 2 months ago

Package Health Score

82 / 100
Full package analysis

Similar packages