Exemple #1
0
def test_raises_error_only_codes_unexpected_missing(test_error,
                                                    auth_missing_error):
    errors = [test_error, auth_missing_error]
    with pytest.raises(pytest.raises.Exception):
        with raises_only_error_codes('UNAUTHORIZED'):
            raise Client.CallActionError(
                actions=[ActionResponse(action='', errors=errors)])
Exemple #2
0
def test_raises_only_error_codes_match(test_error, auth_missing_error):
    errors = [test_error, auth_missing_error]
    with raises_only_error_codes(['AUTH_MISSING', 'TEST']) as exc_info:
        raise Client.CallActionError(
            actions=[ActionResponse(action='', errors=errors)])

    assert exc_info.soa_errors == errors
Exemple #3
0
def test_raises_error_only_codes_unexpected_field_error(
        invalid_event_id_field_error, auth_missing_error):
    errors = [invalid_event_id_field_error, auth_missing_error]
    with pytest.raises(pytest.raises.Exception):
        with raises_only_error_codes('AUTH_MISSING'):
            raise Client.CallActionError(
                actions=[ActionResponse(action='', errors=errors)])
Exemple #4
0
def test_raises_only_error_codes_unexpected(test_error, auth_missing_error):
    errors = [test_error, auth_missing_error]
    with pytest.raises(pytest.raises.Exception):
        with raises_only_error_codes(['AUTH_MISSING']):
            raise Client.CallActionError(
                actions=[ActionResponse(action='', errors=errors)]
            )