mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-06-11 08:44:46 +02:00
22 lines
770 B
Python
22 lines
770 B
Python
from pathlib import Path
|
|
|
|
import yaml
|
|
|
|
|
|
def test_create_identity_schema_matches_supported_identity_types():
|
|
spec_path = Path(__file__).parents[1] / "repeater" / "web" / "openapi.yaml"
|
|
spec = yaml.safe_load(spec_path.read_text(encoding="utf-8"))
|
|
|
|
schema = spec["paths"]["/create_identity"]["post"]["requestBody"]["content"][
|
|
"application/json"
|
|
]["schema"]
|
|
properties = schema["properties"]
|
|
|
|
assert properties["type"]["enum"] == ["companion", "room_server"]
|
|
assert {"node_name", "tcp_port", "bind_address"} <= set(properties["settings"]["properties"])
|
|
assert set(
|
|
spec["paths"]["/create_identity"]["post"]["requestBody"]["content"]["application/json"][
|
|
"examples"
|
|
]
|
|
) == {"companion", "room_server"}
|