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:
assert(sio.is_connected() == False)
assert(sio.get_connect_error().message == 'MY_CUSTOM_ERROR_CODE')
assert(sio.get_disconnect_reason() == 'io server disconnect')
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.
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_receivedDescribe 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.