Skip to main content

Pydantic models for pytest-httpchain

Project description

pytest-httpchain-models

The Pydantic models that define and validate pytest-httpchain test scenarios.

This package is the typed schema for a scenario file. It models the whole structure — Scenario, Stage, Request, the discriminated body types (JSON, XML, form, text, base64, binary, files, GraphQL), variable substitutions, response verification and save steps, parametrization, and parallel execution configs. Every model derives from a strict base (extra="forbid"), so a misspelled field is rejected at validation time instead of silently changing a request. Validation runs in two phases: first with {{ }} template strings treated as opaque, then again on the concrete values after the templates engine renders them, so the rendered value is checked against its real type. These models are also the source the editor-facing JSON Schema is derived from, though the schema itself is built by build_schema() in the main plugin (src/pytest_httpchain/schema.py) and surfaced via the pytest-httpchain schema command — not generated by this package.

Role in the workspace

After pytest-httpchain-jsonref inlines a scenario's $ref directives, the plugin validates the resulting document against Scenario here. These models are the single source of truth for what a scenario may contain — both at pytest collection time and for the JSON Schema editors consume.

Usage

from pytest_httpchain_models.entities import Scenario

scenario = Scenario.model_validate(
    {
        "stages": [
            {
                "name": "health",
                "request": {"url": "https://api.example.com/health"},
                "response": [{"verify": {"status": 200}}],
            }
        ]
    }
)

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_httpchain_models-0.8.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_httpchain_models-0.8.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file pytest_httpchain_models-0.8.1.tar.gz.

File metadata

  • Download URL: pytest_httpchain_models-0.8.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pytest_httpchain_models-0.8.1.tar.gz
Algorithm Hash digest
SHA256 de95d83c143c7cf56bbdc1df55057c7f6dba0ecbac1cdc13f1b51b8a48c50379
MD5 6f8bc07da731fcd310dfda2869e9dc34
BLAKE2b-256 36497288269a2b795ed6be19640df8b99afa13b11abdc62b402428e440d11daa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_httpchain_models-0.8.1.tar.gz:

Publisher: publish.yml on aeresov/pytest-httpchain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_httpchain_models-0.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_httpchain_models-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90b6be4718d1c9732a70c519e12c816e91f3aea4ef4c2bb41a98c1c4ac803f9f
MD5 6f9c74c7f73e6496b5fbe708a59e2d75
BLAKE2b-256 78162c348413d5f7ac0a7b599324dcb2238d1f1ac897531e01a1504734550a8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_httpchain_models-0.8.1-py3-none-any.whl:

Publisher: publish.yml on aeresov/pytest-httpchain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page