-
-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add testing methods/examples #1
Comments
If I can get something working that looks like my sample code I'll make a pull request. If anyone has any other ideas for how to accomplish this, I'd love to see them. |
I was thinking that for unit tests I was going to start the app for real and use a websocket client to acccess it. There is client that looks decent: https://pypi.python.org/pypi/websocket-client/, but I haven't tried it yet. |
I didn't really want to do end to end testing at this stage. And you can set the test_client_class in flask. I think I should be able to extend |
Oh sure, if you manage to get testing going I would take it. I'm not sure you need a connection to the test client, though, since the socket stuff runs independently. You could have a SocketIOTestClient class for example that can send and receive socket.io messages. The Receiving events from the server is going to be a little bit more tricky, you will need to get the |
Well the socket stuff runs independently, but there's a few things on the behavior of the context globals (with respect to their modifications with Flask-SocketIO) in flask that I'd like to test. I'd imagine that it'd be easier to tie it in with an additional mixin to the |
Ah, but the context globals are all handled |
I believe the need for unit tests is now addressed. Closing. |
I'm currently attempting to write a test case for a method with the
@socketio.on
decorator, but there are no simple methods to generate a request that would result in routing to that method.The text was updated successfully, but these errors were encountered: