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()
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")