Standard Conditions#
This module provides basic conditions.
HasText,Regexp,HasCallbackQueryare last-request-based conditions.CheckLastLabelsis a label-based condition.
- class ExactMatch(match, *, skip_none=True)[source]#
Bases:
BaseConditionCheck if
last_requestmatchesmatch.If
skip_none, will not compareNonefields ofmatch.-
match:
Message# Message to compare last request with.
Is initialized according to
MessageInitTypes.
-
match:
- class HasText(text)[source]#
Bases:
BaseConditionCheck if the
textattribute oflast_requestcontainstext.-
text:
str# Text to search for in the last request.
-
text:
- class Regexp(pattern, *, flags=0)[source]#
Bases:
BaseConditionCheck if the
textattribute oflast_requestcontainspattern.-
pattern:
Union[str,Pattern]# The RegExp pattern to search for in the last request.
-
flags:
Union[int,RegexFlag]# Flags to pass to
re.compile.
- property re_object: Pattern#
Compiled pattern.
-
pattern:
- class Any(*conditions)[source]#
Bases:
BaseConditionCheck if any condition from the
conditionslist is True.-
conditions:
List[BaseCondition]# List of conditions.
-
conditions:
- class All(*conditions)[source]#
Bases:
BaseConditionCheck if all conditions from the
conditionslist is True.-
conditions:
List[BaseCondition]# List of conditions.
-
conditions:
- class Negation(condition)[source]#
Bases:
BaseConditionReturn the negation of the result of
condition.-
condition:
BaseCondition# Condition to negate.
-
condition:
- class CheckLastLabels(*, flow_labels=None, labels=None, last_n_indices=1)[source]#
Bases:
BaseConditionCheck if any label in the last
last_n_indicesofContext.labelsis inlabelsor if itsflow_nameis inflow_labels.-
flow_labels:
List[str]# List of flow names to find in the last labels.
-
labels:
List[AbsoluteNodeLabel]# List of labels to find in the last labels.
Is initialized according to
AbsoluteNodeLabelInitTypes.
-
last_n_indices:
int# Number of labels to check.
-
flow_labels:
- class HasCallbackQuery(query_string)[source]#
Bases:
BaseConditionCheck if
last_requestcontains aCallbackQueryattachment withCallbackQuery.query_stringmatchingHasCallbackQuery.query_string.-
query_string:
str# Query string to find in last request’s attachments.
-
query_string: