Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.tool_util.verify.asserts package

galaxy.tool_util.verify.asserts.verify_assertions(data: bytes, assertion_description_list, decompress=None)[source]

This function takes a list of assertions and a string to check these assertions against.

galaxy.tool_util.verify.asserts.verify_assertion(data: bytes, assertion_description)[source]

Submodules

galaxy.tool_util.verify.asserts.archive module

galaxy.tool_util.verify.asserts.archive.assert_has_archive_member(output_bytes: bytes, path: str, verify_assertions_function, children, all: Union[bool, str] = False, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Recursively checks the specified children assertions against the text of the first element matching the specified path found within the archive. Currently supported formats: .zip, .tar, .tar.gz.

galaxy.tool_util.verify.asserts.hdf5 module

galaxy.tool_util.verify.asserts.hdf5.assert_has_h5_attribute(output_bytes: bytes, key: str, value: str) None[source]

Asserts the specified HDF5 output has a given key-value pair as HDF5 attribute

galaxy.tool_util.verify.asserts.hdf5.assert_has_h5_keys(output_bytes: bytes, keys: str) None[source]

Asserts the specified HDF5 output has the given keys.

galaxy.tool_util.verify.asserts.size module

galaxy.tool_util.verify.asserts.size.assert_has_size(output_bytes: bytes, value: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Asserts the specified output has a size of the specified value, allowing for absolute (delta) and relative (delta_frac) difference.

galaxy.tool_util.verify.asserts.tabular module

galaxy.tool_util.verify.asserts.tabular.get_first_line(output: str, comment: str) str[source]

get the first non-comment and non-empty line

galaxy.tool_util.verify.asserts.tabular.assert_has_n_columns(output: str, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, sep: str = '\t', comment: str = '', negate: Union[bool, str] = False) None[source]

Asserts the tabular output contains n columns. The optional sep argument specifies the column seperator used to determine the number of columns. The optional comment argument specifies comment characters

galaxy.tool_util.verify.asserts.text module

galaxy.tool_util.verify.asserts.text.assert_has_text(output: str, text: str, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Asserts specified output contains the substring specified by the argument text. The exact number of occurrences can be optionally specified by the argument n

galaxy.tool_util.verify.asserts.text.assert_not_has_text(output: str, text: str) None[source]

Asserts specified output does not contain the substring specified by the argument text

galaxy.tool_util.verify.asserts.text.assert_has_line(output: str, line: str, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Asserts the specified output contains the line specified by the argument line. The exact number of occurrences can be optionally specified by the argument n

galaxy.tool_util.verify.asserts.text.assert_has_n_lines(output: str, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Asserts the specified output contains n lines allowing for a difference in the number of lines (delta) or relative differebce in the number of lines

galaxy.tool_util.verify.asserts.text.assert_has_text_matching(output: str, expression: str, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Asserts the specified output contains text matching the regular expression specified by the argument expression. If n is given the assertion checks for exacly n (nonoverlapping) occurences.

galaxy.tool_util.verify.asserts.text.assert_has_line_matching(output: str, expression: str, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Asserts the specified output contains a line matching the regular expression specified by the argument expression. If n is given the assertion checks for exactly n occurences.

galaxy.tool_util.verify.asserts.xml module

galaxy.tool_util.verify.asserts.xml.assert_is_valid_xml(output: str) None[source]

Simple assertion that just verifies the specified output is valid XML.

galaxy.tool_util.verify.asserts.xml.assert_has_element_with_path(output: str, path: str, negate: Union[bool, str] = False) None[source]

Asserts the specified output has at least one XML element with a path matching the specified path argument. Valid paths are the simplified subsets of XPath implemented by lxml.etree; https://lxml.de/xpathxslt.html for more information.

galaxy.tool_util.verify.asserts.xml.assert_has_n_elements_with_path(output: str, path: str, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Asserts the specified output has exactly n elements matching the path specified.

galaxy.tool_util.verify.asserts.xml.assert_element_text_matches(output: str, path: str, expression: str, negate: Union[bool, str] = False) None[source]

Asserts the text of the first element matching the specified path matches the specified regular expression.

galaxy.tool_util.verify.asserts.xml.assert_element_text_is(output: str, path: str, text: str, negate: Union[bool, str] = False) None[source]

Asserts the text of the first element matching the specified path matches exactly the specified text.

galaxy.tool_util.verify.asserts.xml.assert_attribute_matches(output: str, path: str, attribute, expression: str, negate: Union[bool, str] = False) None[source]

Asserts the specified attribute of the first element matching the specified path matches the specified regular expression.

galaxy.tool_util.verify.asserts.xml.assert_attribute_is(output: str, path: str, attribute: str, text, negate: Union[bool, str] = False) None[source]

Asserts the specified attribute of the first element matching the specified path matches exactly the specified text.

galaxy.tool_util.verify.asserts.xml.assert_element_text(output: str, path: str, verify_assertions_function, children, negate: Union[bool, str] = False) None[source]

Recursively checks the specified assertions against the text of the first element matching the specified path.

galaxy.tool_util.verify.asserts.xml.assert_xml_element(output: str, path: str, verify_assertions_function=None, children=None, attribute: Optional[str] = None, all: Union[bool, str] = False, n: Optional[Union[int, str]] = None, delta: Union[int, str] = 0, min: Optional[Union[int, str]] = None, max: Optional[Union[int, str]] = None, negate: Union[bool, str] = False) None[source]

Check if path occurs in the xml. If n and delta or min and max are given also the number of occurences is checked. If there are any sub assertions then check them against - the element’s text if attribute is None - the content of the attribute If all is True then the sub assertions are checked for all occurences.