mirror of
https://github.com/zap-proto/spec.git
synced 2026-10-30 15:04:03 +00:00
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%.
22 lines
603 B
Python
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)
|