MCPcopy
hub / github.com/encode/starlette / test_http_repr

Function test_http_repr

tests/test_exceptions.py:152–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150
151
152def test_http_repr() -> None:
153 assert repr(HTTPException(404)) == ("HTTPException(status_code=404, detail='Not Found')")
154 assert repr(HTTPException(404, detail="Not Found: foo")) == (
155 "HTTPException(status_code=404, detail='Not Found: foo')"
156 )
157
158 class CustomHTTPException(HTTPException):
159 pass
160
161 assert repr(CustomHTTPException(500, detail="Something custom")) == (
162 "CustomHTTPException(status_code=500, detail='Something custom')"
163 )
164
165
166def test_websocket_str() -> None:

Callers

nothing calls this directly

Calls 2

HTTPExceptionClass · 0.90
CustomHTTPExceptionClass · 0.85

Tested by

no test coverage detected