mirror of
https://github.com/Sea-Haven-Industries/procurement-ingest.git
synced 2026-10-07 16:08:54 +00:00
132 tests: golden-file comparison for all 25 positive fixtures (17 single-line new-PO + 8 cancellations, Decimal-exact via parse_float=Decimal), every fail-closed gate reason code covered (body-level triggers via 17 synthetic adversarial .eml mutations, candidate-level via direct validate() unit tests), real multi-line and comment/non-Coupa fallback fixtures, dual line-ending parse identity, two-path enrich/save parity (site-extractor stream guard), V10 URL-id corpus sweep, fixture hygiene (ses_auth pass + scrub-marker leak sweep), and Bedrock dispatch/EMF assertions. The suite loads handler/template_parser via importlib under unique module names and binds the handler's bare sibling imports around exec (tests/conftest.py load_handler gets the same treatment) -- the WO suite caches bare 'handler'/'template_parser' names in sys.modules, and bare imports here would silently bind to the wrong pipeline. moto is imported before the handler so its botocore stubber hook precedes boto3 session creation (the PO conftest chain now loads at pytest session start). Fixtures are scrubbed real S3 samples: transport/auth header values replaced with same-shape placeholders (structure kept so ses_auth still passes), per-file digit ciphers, amounts remapped with sum==total re-established. The .gitignore exception is scoped to the PO fixtures path only. Refs: #99
49 lines
899 B
JSON
49 lines
899 B
JSON
{
|
|
"email_type": "cancellation",
|
|
"po_number": "2D-45040819",
|
|
"po_status": null,
|
|
"source_system": "coupa",
|
|
"submitted_by": null,
|
|
"on_behalf_of": null,
|
|
"order_date": null,
|
|
"revision_date": null,
|
|
"last_opened": null,
|
|
"acknowledged_at": null,
|
|
"payment_terms": null,
|
|
"requisition_number": null,
|
|
"department": null,
|
|
"view_order_url": null,
|
|
"supplier": {
|
|
"name": null
|
|
},
|
|
"site_code": null,
|
|
"ship_to": {
|
|
"name": null,
|
|
"address": null,
|
|
"street": null,
|
|
"city": null,
|
|
"state": null,
|
|
"zip": null,
|
|
"location_code": null,
|
|
"attn": null
|
|
},
|
|
"total_amount": null,
|
|
"currency": null,
|
|
"fiscal_year": null,
|
|
"trade": null,
|
|
"coupa_category": null,
|
|
"line_items": [
|
|
{
|
|
"description": null,
|
|
"amount": null,
|
|
"currency": null,
|
|
"need_by": null,
|
|
"category": null,
|
|
"account_code": null,
|
|
"period": null,
|
|
"quantity": null,
|
|
"unit": null,
|
|
"price": null
|
|
}
|
|
]
|
|
}
|