Esempio n. 1
0
def test_create_log_group_no_credentials_error(mocker):
    mocker.patch(
        "mount_efs.cloudwatch_create_log_group_helper",
        side_effect=[NoCredentialsError()],
    )
    is_completed = mount_efs.create_cloudwatch_log_group(
        MOCK_AGENT, DEFAULT_CLOUDWATCH_LOG_GROUP)
    assert is_completed == False
def _test_create_log_group_client_error(mocker,
                                        exception,
                                        desired_result=False):
    operation_name = 'CreateLogGroup'
    response = {'Error': {'Code': exception, 'Message': exception}}
    mocker.patch('mount_efs.cloudwatch_create_log_group_helper',
                 side_effect=[ClientError(response, operation_name)])
    is_completed = mount_efs.create_cloudwatch_log_group(
        MOCK_AGENT, DEFAULT_CLOUDWATCH_LOG_GROUP)
    assert is_completed == desired_result
Esempio n. 3
0
def _test_create_log_group_client_error(mocker,
                                        exception,
                                        desired_result=False):
    operation_name = "CreateLogGroup"
    response = {"Error": {"Code": exception, "Message": exception}}
    mocker.patch(
        "mount_efs.cloudwatch_create_log_group_helper",
        side_effect=[ClientError(response, operation_name)],
    )
    is_completed = mount_efs.create_cloudwatch_log_group(
        MOCK_AGENT, DEFAULT_CLOUDWATCH_LOG_GROUP)
    assert is_completed == desired_result