Files
zeekay ae99594892 test(python): cover client/gateway/server stubs + config loading
Add test_client/test_gateway/test_server and extend test_config to
exercise the async stub modules (connect/list/call, add/remove/list
servers, run() startup) and Config.load + non-Darwin default_path.

Lifts total coverage 85% -> 91%, giving the 80% gate real headroom
across the 3.10/3.11/3.12 matrix. Ignore .coverage/coverage.xml so
build artifacts stay out of the tree.

129 passed; client/config/gateway/server at 100%, identity 92%, crypto 82%.
2026-06-20 02:27:37 -07:00

22 lines
603 B
Python

"""Tests for zap_schema.server module."""
import asyncio
import pytest
from zap_schema.config import Config
from zap_schema.server import Server
class TestServer:
def test_default_config(self):
assert Server().config.port == 9999
def test_custom_config(self):
assert Server(Config(port=4321)).config.port == 4321
async def test_run_blocks_after_startup(self):
# run() prints its listen address then waits forever -> expect timeout.
with pytest.raises(asyncio.TimeoutError):
await asyncio.wait_for(Server(Config(port=0)).run(), timeout=0.1)