seaworthy.testtools

Some (optional) utilities for use with testtools.

While Seaworthy doesn’t require testtools, we find it useful in downstream container tests we write with Seaworthy. This module contains various bits and pieces to make Seaworthy work better with testtools.

class MatchesPsTree(ruser, args, pid=None, ppid=None, children=())[source]

Matches a nested PsTree object in a sensible way.

The ruser and args fields are always checked. The pid and ppid fields are only checked if non-None values are explicitly provided, because real pids are essentially arbitrary integers. The children field is always checked, but order is ignored.

match(value)[source]

Return None if this matcher matches something, a PsTreeMismatch otherwise.

class PsTreeMismatch(row_fields, child_count, fields_mm, children_mm)[source]

Custom mismatch container for MatchesPsTree so we get somewhat more comprehensible failure messages.

describe()[source]

Describe the mismatch.