- integrations
- Python
- ocx_sdk
TestResult
TestResultclassdataclass#
Re-exported from
ocx_sdk._resultsView sourceclass TestResult(status: str, run: TestRun | None = None, assertion: Assertion | None = None)ocx package test --script — the stable v1 envelope.
Only the --script form produces this. The trailing -- CMD form
prints the child’s raw stdout verbatim, even under --format json, so
parsing that output here would either fail loudly or — worse — succeed on
a child that happened to print JSON. The client layer never routes -- CMD
output into this parser.
status decides pass or fail; assertion.kind says why a failure failed.
Attributes
| Name | Type | Description |
|---|---|---|
status | str | "passed" or the failure ocx named. |
run | TestRun | None | What the tested command did, or None when nothing ran.
Always-present-nullable (D7): script_run.rs:74 carries no
skip_serializing_if, so a null here is ocx saying the script
reached no terminal ocx.run — not a run whose fields defaulted. |
assertion | Assertion | None | The assertion that fired, or None when it passed.
Always-present-nullable for the same reason (script_run.rs:73). |
assertionattributeclass attributeinstance attribute#
assertion: Assertion | None = Nonerunattributeclass attributeinstance attribute#
run: TestRun | None = Nonestatusattributeinstance attribute#
status: strpassedproperty#
passed: boolWhether the test passed — status decides, never the exit code.
from_jsonmethodclassmethod#
def from_json(raw: str) -> TestResultParse ocx --format json package test --script ... output.