Replies: 3 comments
-
How are you planning to set the error code/message and disconnect reason from the server side? |
Beta Was this translation helpful? Give feedback.
-
Either by calling the |
Beta Was this translation helpful? Give feedback.
-
The disconnect function does not have a way to provide details. The I think it might be possible to access the value(s) that you include when you raise the exception, but that is far as this feature can go, it can't be mode more specific than that because the Socket.IO protocol does not have any of the things you want to check for. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Our codebase has a bunch of specific disconnect reasons that we'd like to write tests for (Too many connections, bad authentication, etc.) Right now we write the tests just checking if
is_connected() == False
, however it would be nice if we could test which error came back.Describe the solution you'd like
Something to the tune of:
They could also raise if you're still connected ala
get_received
Describe alternatives you've considered
I could mock the functions to check when they raise or disconnect, but this ties my tests really tightly to the server implementation. It would be nice if I could do some refactoring without having to update my test mocks.
Beta Was this translation helpful? Give feedback.
All reactions