Skip to content

Commit 2066078

Browse files
committed
test(schema): verify generated descriptions are readable
1 parent d03ed5c commit 2066078

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/test_gen_all.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from acp.schema import AvailableCommandInput, ReadTextFileRequest
12
from scripts.gen_all import resolve_ref, schema_source_paths
23
from scripts.gen_schema import (
34
_deserialize_field_specs,
@@ -9,6 +10,16 @@
910
)
1011

1112

13+
def test_generated_field_descriptions_are_introspectable() -> None:
14+
path_description = "Absolute path to the file to read."
15+
assert ReadTextFileRequest.model_fields["path"].description == path_description
16+
assert ReadTextFileRequest.model_json_schema()["properties"]["path"]["description"] == path_description
17+
18+
root_description = "The input specification for a command."
19+
assert AvailableCommandInput.model_fields["root"].description == root_description
20+
assert AvailableCommandInput.model_json_schema()["description"] == root_description
21+
22+
1223
def test_resolve_ref_accepts_schema_release_tags() -> None:
1324
assert resolve_ref("schema-v1.16.0") == "refs/tags/schema-v1.16.0"
1425

0 commit comments

Comments
 (0)