MCPcopy
hub / github.com/sanic-org/sanic / test_exception_message_attribute

Function test_exception_message_attribute

tests/test_exceptions.py:405–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

403
404
405def test_exception_message_attribute():
406 assert ServerError("it failed").message == "it failed"
407 assert ServerError(b"it failed").message == "it failed"
408 assert (
409 ServerError().message == str(ServerError()) == "Internal Server Error"
410 )
411
412 class CustomError(SanicException):
413 message = "Something bad happened"
414
415 assert CustomError().message == CustomError.message == str(CustomError())
416 assert SanicException().message != ""
417 assert SanicException("").message == ""
418
419
420def test_exception_quiet_attribute():

Callers

nothing calls this directly

Calls 3

ServerErrorClass · 0.90
SanicExceptionClass · 0.90
CustomErrorClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…