Fix server version parsing
This commit is contained in:
@@ -50,6 +50,17 @@ def test_client_ip_ignores_forwarded_for_from_non_loopback_peer() -> None:
|
||||
assert server._client_ip(client) == "203.0.113.20"
|
||||
|
||||
|
||||
def test_resolve_server_version_reads_release_and_revision(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
version_text = """
|
||||
window.CHGRID_RELEASE_VERSION = "0.1.0";
|
||||
window.CHGRID_BUILD_REVISION = "R348";
|
||||
window.CHGRID_WEB_VERSION = `${window.CHGRID_RELEASE_VERSION} ${window.CHGRID_BUILD_REVISION}`;
|
||||
""".strip()
|
||||
resolved = SignalingServer._version_from_web_version_text(version_text)
|
||||
|
||||
assert resolved == "0.1.0 R348"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_position_rejects_out_of_bounds(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
server = SignalingServer("127.0.0.1", 8765, None, None, grid_size=41)
|
||||
|
||||
Reference in New Issue
Block a user