Skip to content

Commit

Permalink
Add test for generated schema
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoliaw committed Jun 25, 2024
1 parent 5efa7c3 commit de2b672
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/core/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,20 @@ def test_add_plan(empty_context: BlueskyContext, plan: PlanGenerator) -> None:
assert plan.__name__ in empty_context.plans


def test_generated_schema(
empty_context: BlueskyContext,
):
def demo_plan(foo: int, mov: Movable) -> MsgGenerator: # type: ignore
...

empty_context.plan(demo_plan)
schema = empty_context.plans["demo_plan"].model.schema()
assert schema["properties"] == {
"foo": {"title": "Foo", "type": "integer"},
"mov": {"title": "Mov", "type": repr(Movable)},
}


@pytest.mark.parametrize(
"plan", [has_typeless_param, has_typed_and_typeless_params, has_typeless_params]
)
Expand Down

0 comments on commit de2b672

Please sign in to comment.