Files
devplacepy/tests/unit/docs_api/_shared.py
T
retoor cae139ead9
DevPlace CI / test (push) Failing after 28m20s
Add personal notes, DeepSearch history, backup offload, and gateway auth throttling
Also streamline the top navigation: drop the Tools dropdown, make Quizzes
and Battles icon-only entries, and remove the Workspace, Containers and
Editor entry points from the project detail page.
2026-09-12 20:32:31 +02:00

37 lines
1.0 KiB
Python

from devplacepy.docs_api import field, endpoint
def test_field_defaults_nullable_false():
spec = field("username", "path", "string", True, "alice", "A username.")
assert spec["nullable"] is False
def test_field_nullable_true_is_threaded_into_spec():
spec = field(
"avatar_seed",
"response",
"string",
description="Null falls back to the username.",
nullable=True,
)
assert spec["nullable"] is True
assert spec["location"] == "response"
def test_endpoint_carries_response_field_specs_in_params():
ep = endpoint(
id="example",
method="GET",
path="/example",
title="Example",
summary="An example endpoint.",
auth="public",
params=[
field("uid", "response", "string", nullable=False),
field("bio", "response", "string", nullable=True),
],
)
by_name = {p["name"]: p for p in ep["params"]}
assert by_name["uid"]["nullable"] is False
assert by_name["bio"]["nullable"] is True