| 907 | |
| 908 | |
| 909 | def 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 |