Files
SlabUploader/test-results/d1-fix-2026-09-07/RESULTS.md
T
grokbot_ty d5d5cded62 fix(D-1): python-multipart install fix for TestCreateSlab (#29)
D-1 contract tests now pass (8/8). The python-multipart>=0.0.30,<1
dependency was already in requirements.txt but the venv was not rebuilt
after it was added, causing all 8 TestCreateSlab tests to fail with:

  AssertionError: The python-multipart library must be installed

The endpoint POST /api/v1/slabs correctly returns 201 with status
calibrated and server_rev for multipart uploads containing data JSON,
files[], and meta[].

Evidence: test-results/d1-fix-2026-09-07/pytest.txt (8 passed)
2026-09-07 18:19:23 +00:00

53 lines
2.0 KiB
Markdown

# D-1 fix results — 2026-09-07
Evidence collected on gate-b @ 699b6a0. Fixes issue #29.
---
## D-1: Draft store stub — POST /api/v1/slabs
### Root cause
`python-multipart` was missing from the test venv. The dependency `python-multipart>=0.0.30,<1` was already in `backend/requirements.txt` (added in commit 5019b10) but the venv had not been rebuilt after the requirement was added. All 8 TestCreateSlab tests failed with:
```
AssertionError: The `python-multipart` library must be installed to use form parsing.
```
Starlette's `Request._get_form()` tries to import `parse_options_header` from `python_multipart.multipart` and falls back to `multipart.multipart`. When neither is available, it asserts `parse_options_header is not None` and fails.
### Fix
Installed `python-multipart==0.0.32` into the venv. The requirement was already correct in `backend/requirements.txt`; the Dockerfile already installs from requirements.txt. The fix is ensuring the dependency is present in the execution environment.
---
## Results
| Case | Evidence class | Result | Evidence |
|---|---|---|---|
| D-1: test_returns_201 | `api-contract` | pass | pytest.txt:1 |
| D-1: test_returns_status_calibrated | `api-contract` | pass | pytest.txt:2 |
| D-1: test_returns_server_rev | `api-contract` | pass | pytest.txt:3 |
| D-1: test_response_shape | `api-contract` | pass | pytest.txt:4 |
| D-1: test_multiple_photos | `api-contract` | pass | pytest.txt:5 |
| D-1: test_missing_data_field_returns_400 | `api-contract` | pass | pytest.txt:6 |
| D-1: test_duplicate_sku_returns_409 | `api-contract` | pass | pytest.txt:7 |
| D-1: test_with_test_client_lifespan | `api-contract` | pass | pytest.txt:8 |
**8 pass / 0 fail / 0 blocked**
---
## Full suite
39 tests passed, 0 failed (pytest-full.txt).
---
## Gate B status
- D-1 now passes. 18 pass / 0 fail / 5 blocked for the full pass2 set.
- Blocked items (TV-3/6/7/10 product-state, OPS-1 deploy) require real fixtures and deployed environment; unchanged.
- Gate B is not green. UAT is not ready.