calico.parse

Specification parsing.

calico.parse.get_attribute(node, test_name, names, val_func, val_args, err_message)

Get the value of an test attribute.

Parameters:
  • node (SpecNode) – Node to get the attribute
  • test_name (str) – Name of the test
  • names (Tuple[str]) – Long and short names of the attribute
  • val_func (Callable[[Any, ..], bool]) – A validator function for the attribute
  • val_args (Any) – An argument to the validator function
  • err_message (str) – An error message to shown when validation fails
calico.parse.get_comment_value(node, name, field)

Get the value of a comment field.

Parameters:
  • node (SpecNode) – Node to get the comment from.
  • name (str) – Name of setting in the node.
  • field (str) – Name of comment field.
Return type:

str

Returns:

Value of comment field.

calico.parse.parse_spec(content)

Parse a test specification.

Parameters:content (str) – Specification to parse.
Return type:Calico
Returns:Created Calico runner.
Raises:AssertionError – When given specification is invalid.