test_server.py - Tests for server.py - The CodeChat Server¶
Imports¶
These are listed in the order prescribed by PEP 8.
Standard library¶
Third-party imports¶
Local imports¶
from CodeChat_Server.constants import HTTP_PORT
from CodeChat_Server.gen_py.CodeChat_Services.ttypes import (
RenderClientReturn,
CodeChatClientLocation,
)
from CodeChat_Server.renderer import _render_CodeChat, _render_markdown, _render_ReST
from CodeChat_Server.render_manager import (
WEBSOCKET_PORT,
GetResultType,
GetResultReturn,
)
from conftest import SUBPROCESS_SERVER_ARGS
import websockets
Constants¶
Tests¶
Editor plug-in¶
Open a port, so that it’s in use.
Run the server.
Check that it reported the ports were in use.
Test the plugin with invalid parameters.
Test the plugin shutdown.
Wait for the server to finish shutting down.
Make sure the server no longer responds to pings to verify it shut down.
CodeChat Client HTTP¶
Make a request of a non-existent ID.
Test on a file that doesn’t exist.
CodeChat Client websocket¶
Test an invalid id.
Test an unknown client.
Renderer tests¶
Make sure a zero-input case works.
Make sure the zero-input case works.
Check basic error reporting.
Requires updated CodeChat for this test to pass.
Make sure the zero-input case works.
Check basic error reporting.
Misc¶
Check that it reported the ports were in use.