Skip to content

Test Model App

openapi_first.templates.model_app.test_model_app

End-to-end tests for the OpenAPI-first model CRUD example app.

These tests validate that all CRUD operations behave correctly against the in-memory mock data store using Pydantic models. - OpenAPI specification loading - OperationId-driven route binding on the server - OperationId-driven client invocation - Pydantic model-based request and response handling

All CRUD operations are exercised against an in-memory mock data store backed by Pydantic domain models.

The tests assume: - OpenAPI-first route binding - Pydantic model validation - In-memory storage (no persistence guarantees) - Deterministic behavior in a single process

Classes

Functions

test_create_item

test_create_item()

Creating a new item should return the created entity.

test_delete_item

test_delete_item()

Deleting an item should remove it from the store.

test_get_item

test_get_item()

Existing item should be retrievable by ID.

test_list_items_initial

test_list_items_initial()

Initial items should be present.

test_update_item

test_update_item()

Updating an item should replace its values.