vinissimus / async-asgi-testclient

A framework-agnostic library for testing ASGI web applications
MIT License
160 stars 20 forks source link

Cannot use `wss://` as the scheme for WebSocket tests #47

Open shevron opened 2 years ago

shevron commented 2 years ago

I'm testing an app that needs to know whether a WebSocket connection was done over ws:// or wss://. Currently, while I can override the scheme for HTTP requests, I cannot set the scheme used for WebSocket connections. Moreover, overriding this behavior via subclassing for example is quite difficult as the scheme is hard-coded inside the WebSocketSession.connect() method which is quite extensive.

It would be helpful if I could override the WS connection scheme and set it to wss:// or ws:// explicitly.