def test_creating_exception_from_call_error_with_unknown_error_code():
    call_error = CallError(
        unique_id="1337",
        error_code="418",
        error_description="I'm a teapot",
    )

    with pytest.raises(UnknownCallErrorCodeError):
        call_error.to_exception()
Esempio n. 2
0
def test_creating_exception_from_call_error():
    call_error = CallError(unique_id="1337",
                           error_code="ProtocolError",
                           error_description="Something went wrong",
                           error_details="Some details about the error")

    assert call_error.to_exception() == ProtocolError(
        description="Something went wrong",
        details="Some details about the error")