Skip to content
ocx
install

TestResult

TestResultclassdataclass#

Re-exported from ocx_sdk._resultsView source
class 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

NameTypeDescription
statusstr"passed" or the failure ocx named.
runTestRun | NoneWhat 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.
assertionAssertion | NoneThe 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 = None

runattributeclass attributeinstance attribute#

run: TestRun | None = None

statusattributeinstance attribute#

status: str

passedproperty#

passed: bool

Whether the test passed — status decides, never the exit code.

from_jsonmethodclassmethod#

def from_json(raw: str) -> TestResult

Parse ocx --format json package test --script ... output.