← ClaudeAtlas

mocking-microcks-pythonlisted

Use when the mocking-strategy-roster resolved (microcks, Python) — the default mocking strategy for a Python integration test. Provides the MicrocksContainer wiring (unofficial microcks-testcontainers binding, pinned) of a Microcks container seeded from the downstream dependency's contract and the pytest fixture that points the system-under-test's HTTP client at the mock URL through the app factory. Emits mock wiring only; the business TDD cycle stays with the software-engineer lead.
SebastienDegodez/skraft-plugin · ★ 14 · Testing & QA · score 70
Install: claude install-skill SebastienDegodez/skraft-plugin
# Mocking — Microcks x Python adapter (default) Mocks a downstream dependency the SUT calls with a Microcks container seeded from that dependency's OpenAPI/examples contract, and wires it into a pytest integration test. Loaded ONLY when `mocking-strategy-roster` resolved `(microcks, Python)`. **Boundary:** mock wiring + an integration-test scaffold. No RED->GREEN, no Object Calisthenics, no provider contract verification (that is `contract-testing-python`). The `software-engineer` lead integrates this into its own TDD loop. ## Dev dependencies ``` microcks-testcontainers @ git+https://github.com/Caesarsage/microcks-testcontainers-python@b61580e9b8dd18be6ea98d3a24ad6248971656dd testcontainers>=4.14 ``` `microcks-testcontainers` is an unofficial binding, not on PyPI: pin it to this commit, never to a branch. It mirrors the official Java/.NET API (`with_main_artifacts`, `get_rest_mock_endpoint`, `verify`). ## Recipe — mock the downstream + wire the app ```python # tests/integration/conftest.py import pytest from fastapi.testclient import TestClient from microcks_testcontainers import MicrocksContainer from {context}.api.app import create_app from {context}.api.composition import build MICROCKS_IMAGE = "quay.io/microcks/microcks-uber:1.14.0-native" @pytest.fixture(scope="session") def microcks(): # Seed mocks from the DOWNSTREAM dependency's contract (not our API). with MicrocksContainer(MICROCKS_IMAGE).with_main_artifacts(["resources/third-parties/{downstream