Loading lib/galaxy/tool_util/verify/asserts/_util.py +29 −4 Original line number Diff line number Diff line from math import inf from typing import ( Any, Callable, Optional ) from galaxy.util import asbool from galaxy.util.bytesize import parse_bytesize def _assert_number(count, n, delta, min, max, negate, n_text, min_max_text): def _assert_number( count, n: Optional[str], delta: str, min: Optional[str], max: Optional[str], negate: str, n_text, min_max_text ): """ helper function for assering that count is in - [n-delta:n+delta] Loading @@ -26,12 +40,12 @@ def _assert_number(count, n, delta, min, max, negate, n_text, min_max_text): ) if min is not None or max is not None: if min is None: min = -inf # also replacing min/max for output min = "-inf" # also replacing min/max for output min_bytes = -inf else: min_bytes = parse_bytesize(min) if max is None: max = inf max = "inf" max_bytes = inf else: max_bytes = parse_bytesize(max) Loading @@ -42,7 +56,18 @@ def _assert_number(count, n, delta, min, max, negate, n_text, min_max_text): def _assert_presence_number( output, text, n, delta, min, max, negate, check_presence_foo, count_foo, presence_text, n_text, min_max_text output, text, n: Optional[str], delta: str, min: Optional[str], max: Optional[str], negate: str, check_presence_foo: Callable[[Any, Any], bool], count_foo: Callable[[Any, Any], int], presence_text: str, n_text: str, min_max_text: str ): """ helper function to assert that Loading lib/galaxy/tool_util/verify/asserts/archive.py +6 −6 Original line number Diff line number Diff line Loading @@ -55,12 +55,12 @@ def assert_has_archive_member( path, verify_assertions_function, children, all="false", n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, all="False", n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Recursively checks the specified children assertions against the text of the first element matching the specified path found within the archive. Loading lib/galaxy/tool_util/verify/asserts/size.py +5 −5 Original line number Diff line number Diff line Loading @@ -5,11 +5,11 @@ from ._util import _assert_number def assert_has_size( output_bytes, value: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, value: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """ Asserts the specified output has a size of the specified value, Loading lib/galaxy/tool_util/verify/asserts/tabular.py +5 −5 Original line number Diff line number Diff line Loading @@ -20,13 +20,13 @@ def get_first_line(output, comment): def assert_has_n_columns( output, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, sep="\t", comment="", negate: bool = False, negate: str = "False", ): """Asserts the tabular output contains n columns. The optional sep argument specifies the column seperator used to determine the Loading lib/galaxy/tool_util/verify/asserts/text.py +25 −25 Original line number Diff line number Diff line Loading @@ -10,11 +10,11 @@ from ._util import ( def assert_has_text( output, text, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts specified output contains the substring specified by the argument text. The exact number of occurrences can be Loading Loading @@ -46,11 +46,11 @@ def assert_not_has_text(output, text): def assert_has_line( output, line, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains the line specified by the argument line. The exact number of occurrences can be optionally Loading @@ -74,11 +74,11 @@ def assert_has_line( def assert_has_n_lines( output, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains ``n`` lines allowing for a difference in the number of lines (delta) Loading @@ -100,11 +100,11 @@ def assert_has_n_lines( def assert_has_text_matching( output, expression, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains text matching the regular expression specified by the argument expression. Loading @@ -130,11 +130,11 @@ def assert_has_text_matching( def assert_has_line_matching( output, expression, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains a line matching the regular expression specified by the argument expression. If n is given Loading Loading
lib/galaxy/tool_util/verify/asserts/_util.py +29 −4 Original line number Diff line number Diff line from math import inf from typing import ( Any, Callable, Optional ) from galaxy.util import asbool from galaxy.util.bytesize import parse_bytesize def _assert_number(count, n, delta, min, max, negate, n_text, min_max_text): def _assert_number( count, n: Optional[str], delta: str, min: Optional[str], max: Optional[str], negate: str, n_text, min_max_text ): """ helper function for assering that count is in - [n-delta:n+delta] Loading @@ -26,12 +40,12 @@ def _assert_number(count, n, delta, min, max, negate, n_text, min_max_text): ) if min is not None or max is not None: if min is None: min = -inf # also replacing min/max for output min = "-inf" # also replacing min/max for output min_bytes = -inf else: min_bytes = parse_bytesize(min) if max is None: max = inf max = "inf" max_bytes = inf else: max_bytes = parse_bytesize(max) Loading @@ -42,7 +56,18 @@ def _assert_number(count, n, delta, min, max, negate, n_text, min_max_text): def _assert_presence_number( output, text, n, delta, min, max, negate, check_presence_foo, count_foo, presence_text, n_text, min_max_text output, text, n: Optional[str], delta: str, min: Optional[str], max: Optional[str], negate: str, check_presence_foo: Callable[[Any, Any], bool], count_foo: Callable[[Any, Any], int], presence_text: str, n_text: str, min_max_text: str ): """ helper function to assert that Loading
lib/galaxy/tool_util/verify/asserts/archive.py +6 −6 Original line number Diff line number Diff line Loading @@ -55,12 +55,12 @@ def assert_has_archive_member( path, verify_assertions_function, children, all="false", n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, all="False", n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Recursively checks the specified children assertions against the text of the first element matching the specified path found within the archive. Loading
lib/galaxy/tool_util/verify/asserts/size.py +5 −5 Original line number Diff line number Diff line Loading @@ -5,11 +5,11 @@ from ._util import _assert_number def assert_has_size( output_bytes, value: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, value: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """ Asserts the specified output has a size of the specified value, Loading
lib/galaxy/tool_util/verify/asserts/tabular.py +5 −5 Original line number Diff line number Diff line Loading @@ -20,13 +20,13 @@ def get_first_line(output, comment): def assert_has_n_columns( output, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, sep="\t", comment="", negate: bool = False, negate: str = "False", ): """Asserts the tabular output contains n columns. The optional sep argument specifies the column seperator used to determine the Loading
lib/galaxy/tool_util/verify/asserts/text.py +25 −25 Original line number Diff line number Diff line Loading @@ -10,11 +10,11 @@ from ._util import ( def assert_has_text( output, text, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts specified output contains the substring specified by the argument text. The exact number of occurrences can be Loading Loading @@ -46,11 +46,11 @@ def assert_not_has_text(output, text): def assert_has_line( output, line, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains the line specified by the argument line. The exact number of occurrences can be optionally Loading @@ -74,11 +74,11 @@ def assert_has_line( def assert_has_n_lines( output, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains ``n`` lines allowing for a difference in the number of lines (delta) Loading @@ -100,11 +100,11 @@ def assert_has_n_lines( def assert_has_text_matching( output, expression, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains text matching the regular expression specified by the argument expression. Loading @@ -130,11 +130,11 @@ def assert_has_text_matching( def assert_has_line_matching( output, expression, n: Optional[int] = None, delta: int = 0, min: Optional[int] = None, max: Optional[int] = None, negate: bool = False, n: Optional[str] = None, delta: str = "0", min: Optional[str] = None, max: Optional[str] = None, negate: str = "False", ): """Asserts the specified output contains a line matching the regular expression specified by the argument expression. If n is given Loading