jaraco / jaraco.abode

MIT License
11 stars 9 forks source link

Test events API #17

Open jaraco opened 1 year ago

jaraco commented 1 year ago

The Socket IO / events controller currently has poor test coverage:

jaraco/abode/event_controller.py              169     28    83%   61, 65, 69-76, 80-87, 127, 175, 180, 184, 188-200, 204-208
jaraco/abode/socketio.py                      230    135    41%   89, 92, 115-118, 122-125, 130, 140-147, 151-159, 162-185, 188-211, 214-218, 221-227, 230-247, 250-264, 267, 270-282, 285-289, 292-293, 296-308, 311-313, 316-320, 323-325, 328-339, 342-349

As a result, bugs such as those in #14 were allowed to creep into the project.

Today, I did a search and found mocket that looks pretty mature and may enable testing some of the websocket behaviors.

jaraco commented 1 year ago

I was wrong about mocket. It doesn't do websockets, just regular HTTP.

jaraco commented 1 year ago

I started looking into creating a mock socketio server in https://github.com/jaraco/jaraco.abode/tree/tests/17-events, but I found it challenging to start up a server and tear it down. Moreover, I don't fully understand the Websocket/EngineIO/SocketIO protocols. I'm unlikely to make progress on this, but I'm eager for any solution. Contributions encouraged.