faust.livecheck.models
¶
LiveCheck - Models.
- class faust.livecheck.models.State(value)[source]¶
Test execution status.
- INIT = 'INIT'¶
- DO_NOT_SHARE = '111/***/111'¶
- FAIL = 'FAIL'¶
- ERROR = 'ERROR'¶
- TIMEOUT = 'TIMEOUT'¶
- STALL = 'STALL'¶
- SKIP = 'SKIP'¶
- class faust.livecheck.models.SignalEvent(signal_name, case_name, key, value, *, __strict__=True, __faust=None, **kwargs)[source]¶
Signal sent to test (see
faust.livecheck.signals.Signal
).- key: Any¶
Describes a field.
Used for every field in Record so that they can be used in join’s /group_by etc.
Examples
>>> class Withdrawal(Record): ... account_id: str ... amount: float = 0.0
>>> Withdrawal.account_id <FieldDescriptor: Withdrawal.account_id: str> >>> Withdrawal.amount <FieldDescriptor: Withdrawal.amount: float = 0.0>
- Parameters:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- value: Any¶
Describes a field.
Used for every field in Record so that they can be used in join’s /group_by etc.
Examples
>>> class Withdrawal(Record): ... account_id: str ... amount: float = 0.0
>>> Withdrawal.account_id <FieldDescriptor: Withdrawal.account_id: str> >>> Withdrawal.amount <FieldDescriptor: Withdrawal.amount: float = 0.0>
- Parameters:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- asdict()¶
Convert record to Python dictionary.
- class faust.livecheck.models.TestExecution(id, case_name, timestamp, test_args, test_kwargs, expires, *, __strict__=True, __faust=None, **kwargs)[source]¶
Requested test execution.
- test_args: List[Any]¶
Describes a field.
Used for every field in Record so that they can be used in join’s /group_by etc.
Examples
>>> class Withdrawal(Record): ... account_id: str ... amount: float = 0.0
>>> Withdrawal.account_id <FieldDescriptor: Withdrawal.account_id: str> >>> Withdrawal.amount <FieldDescriptor: Withdrawal.amount: float = 0.0>
- Parameters:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- test_kwargs: Dict[str, Any]¶
Describes a field.
Used for every field in Record so that they can be used in join’s /group_by etc.
Examples
>>> class Withdrawal(Record): ... account_id: str ... amount: float = 0.0
>>> Withdrawal.account_id <FieldDescriptor: Withdrawal.account_id: str> >>> Withdrawal.amount <FieldDescriptor: Withdrawal.amount: float = 0.0>
- Parameters:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- classmethod from_headers(headers: Mapping) Optional[TestExecution] [source]¶
Create instance from mapping of HTTP/Kafka headers.
- Return type:
_UnionGenericAlias
[TestExecution
,None
]
- as_headers() Mapping [source]¶
Return test metadata as mapping of HTTP/Kafka headers.
- Return type:
_SpecialGenericAlias
- asdict()¶
Convert record to Python dictionary.
- class faust.livecheck.models.TestReport(case_name, state, signal_latency, test=None, runtime=None, error=None, traceback=None, *, __strict__=True, __faust=None, **kwargs)[source]¶
Report after test execution.
- state: State¶
Describes a field.
Used for every field in Record so that they can be used in join’s /group_by etc.
Examples
>>> class Withdrawal(Record): ... account_id: str ... amount: float = 0.0
>>> Withdrawal.account_id <FieldDescriptor: Withdrawal.account_id: str> >>> Withdrawal.amount <FieldDescriptor: Withdrawal.amount: float = 0.0>
- Parameters:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- test: Optional[TestExecution]¶
Describes a field.
Used for every field in Record so that they can be used in join’s /group_by etc.
Examples
>>> class Withdrawal(Record): ... account_id: str ... amount: float = 0.0
>>> Withdrawal.account_id <FieldDescriptor: Withdrawal.account_id: str> >>> Withdrawal.amount <FieldDescriptor: Withdrawal.amount: float = 0.0>
- Parameters:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- signal_latency: Dict[str, float]¶
Describes a field.
Used for every field in Record so that they can be used in join’s /group_by etc.
Examples
>>> class Withdrawal(Record): ... account_id: str ... amount: float = 0.0
>>> Withdrawal.account_id <FieldDescriptor: Withdrawal.account_id: str> >>> Withdrawal.amount <FieldDescriptor: Withdrawal.amount: float = 0.0>
- Parameters:
- Keyword Arguments:
model (Type) – Model class the field belongs to.
parent (FieldDescriptorT) – parent field if any.
- asdict()¶
Convert record to Python dictionary.