MCPcopy
hub / github.com/pallets/werkzeug / test_client_response_wrapper

Function test_client_response_wrapper

tests/test_test.py:909–927  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

907
908
909def test_client_response_wrapper():
910 class CustomResponse(Response):
911 pass
912
913 class CustomTestResponse(TestResponse, Response):
914 pass
915
916 c1 = Client(Response(), CustomResponse)
917 r1 = c1.open()
918
919 assert isinstance(r1, CustomResponse)
920 assert type(r1) is not CustomResponse # Got subclassed
921 assert issubclass(type(r1), CustomResponse)
922
923 c2 = Client(Response(), CustomTestResponse)
924 r2 = c2.open()
925
926 assert isinstance(r2, CustomTestResponse)
927 assert type(r2) is CustomTestResponse # Did not get subclassed

Callers

nothing calls this directly

Calls 3

openMethod · 0.95
ClientClass · 0.90
ResponseClass · 0.90

Tested by

no test coverage detected