Fix server version parsing

This commit is contained in:
Jage9
2026-03-09 01:42:59 -04:00
parent b49412a800
commit 97ff19581a
3 changed files with 34 additions and 6 deletions

View File

@@ -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)