Public Member Functions | |
| def | fail (self, msg=None, *tags) |
| Fails the test with the given message and optionally alters its tags. More... | |
| def | fatal_error (self, msg=None) |
| Stops the whole test execution. More... | |
| def | get_count (self, container, item) |
Returns and logs how many times item is found from container. More... | |
| def | get_length (self, item) |
| Returns and logs the length of the given item as an integer. More... | |
| def | length_should_be (self, item, length, msg=None) |
| Verifies that the length of the given item is correct. More... | |
| def | should_be_empty (self, item, msg=None) |
| Verifies that the given item is empty. More... | |
| def | should_be_equal (self, first, second, msg=None, values=True, ignore_case=False, formatter='str', strip_spaces=False, collapse_spaces=False) |
| Fails if the given objects are unequal. More... | |
| def | should_be_equal_as_integers (self, first, second, msg=None, values=True, base=None) |
| Fails if objects are unequal after converting them to integers. More... | |
| def | should_be_equal_as_numbers (self, first, second, msg=None, values=True, precision=6) |
| Fails if objects are unequal after converting them to real numbers. More... | |
| def | should_be_equal_as_strings (self, first, second, msg=None, values=True, ignore_case=False, strip_spaces=False, formatter='str', collapse_spaces=False) |
| Fails if objects are unequal after converting them to strings. More... | |
| def | should_be_true (self, condition, msg=None) |
| Fails if the given condition is not true. More... | |
| def | should_contain (self, container, item, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
Fails if container does not contain item one or more times. More... | |
| def | should_contain_any (self, container, *items, **configuration) |
Fails if container does not contain any of the *items. More... | |
| def | should_contain_x_times (self, container, item, count, msg=None, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
Fails if container does not contain item count times. More... | |
| def | should_end_with (self, str1, str2, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
Fails if the string str1 does not end with the string str2. More... | |
| def | should_match (self, string, pattern, msg=None, values=True, ignore_case=False) |
Fails if the given string does not match the given pattern. More... | |
| def | should_match_regexp (self, string, pattern, msg=None, values=True, flags=None) |
Fails if string does not match pattern as a regular expression. More... | |
| def | should_not_be_empty (self, item, msg=None) |
| Verifies that the given item is not empty. More... | |
| def | should_not_be_equal (self, first, second, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
| Fails if the given objects are equal. More... | |
| def | should_not_be_equal_as_integers (self, first, second, msg=None, values=True, base=None) |
| Fails if objects are equal after converting them to integers. More... | |
| def | should_not_be_equal_as_numbers (self, first, second, msg=None, values=True, precision=6) |
| Fails if objects are equal after converting them to real numbers. More... | |
| def | should_not_be_equal_as_strings (self, first, second, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
| Fails if objects are equal after converting them to strings. More... | |
| def | should_not_be_true (self, condition, msg=None) |
| Fails if the given condition is true. More... | |
| def | should_not_contain (self, container, item, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
Fails if container contains item one or more times. More... | |
| def | should_not_contain_any (self, container, *items, **configuration) |
Fails if container contains one or more of the *items. More... | |
| def | should_not_end_with (self, str1, str2, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
Fails if the string str1 ends with the string str2. More... | |
| def | should_not_match (self, string, pattern, msg=None, values=True, ignore_case=False) |
Fails if the given string matches the given pattern. More... | |
| def | should_not_match_regexp (self, string, pattern, msg=None, values=True, flags=None) |
Fails if string matches pattern as a regular expression. More... | |
| def | should_not_start_with (self, str1, str2, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
Fails if the string str1 starts with the string str2. More... | |
| def | should_start_with (self, str1, str2, msg=None, values=True, ignore_case=False, strip_spaces=False, collapse_spaces=False) |
Fails if the string str1 does not start with the string str2. More... | |
Private Member Functions | |
| def | _collapse_spaces (self, value) |
| def | _get_length (self, item) |
| def | _get_string_msg (self, item1, item2, custom_message, include_values, delimiter, quote_item1=True, quote_item2=True) |
| def | _include_values (self, values) |
| def | _log_types_at_info_if_different (self, first, second) |
| def | _raise_multi_diff (self, first, second, msg, formatter) |
| def | _set_and_remove_tags (self, tags) |
| def | _should_be_equal (self, first, second, msg, values, formatter='str') |
| def | _should_not_be_equal (self, first, second, msg, values) |
| def | _strip_spaces (self, value, strip_spaces) |
Additional Inherited Members | |
Properties inherited from robot.libraries.BuiltIn._BuiltInBase | |
| _context = property | |
| _namespace = property | |
| _variables = property | |
Definition at line 480 of file BuiltIn.py.
|
private |
Definition at line 666 of file BuiltIn.py.
|
private |
Definition at line 1397 of file BuiltIn.py.
|
private |
Definition at line 1450 of file BuiltIn.py.
|
private |
Definition at line 652 of file BuiltIn.py.
|
private |
Definition at line 633 of file BuiltIn.py.
|
private |
Definition at line 637 of file BuiltIn.py.
|
private |
Definition at line 482 of file BuiltIn.py.
|
private |
Definition at line 624 of file BuiltIn.py.
|
private |
Definition at line 706 of file BuiltIn.py.
|
private |
Definition at line 655 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.fail | ( | self, | |
msg = None, |
|||
| * | tags | ||
| ) |
Fails the test with the given message and optionally alters its tags.
The error message is specified using the ``msg`` argument.
It is possible to use HTML in the given error message, similarly
as with any other keyword accepting an error message, by prefixing
the error with ``*HTML*``.
It is possible to modify tags of the current test case by passing tags
after the message. Tags starting with a hyphen (e.g. ``-regression``)
are removed and others added. Tags are modified using `Set Tags` and
`Remove Tags` internally, and the semantics setting and removing them
are the same as with these keywords.
Examples:
| Fail | Test not ready | | | # Fails with the given message. |
| Fail | *HTML*<b>Test not ready</b> | | | # Fails using HTML in the message. |
| Fail | Test not ready | not-ready | | # Fails and adds 'not-ready' tag. |
| Fail | OS not supported | -regression | | # Removes tag 'regression'. |
| Fail | My message | tag | -t* | # Removes all tags starting with 't' except the newly added 'tag'. |
See `Fatal Error` if you need to stop the whole test execution.
Definition at line 512 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.fatal_error | ( | self, | |
msg = None |
|||
| ) |
Stops the whole test execution.
The test or suite where this keyword is used fails with the provided
message, and subsequent tests fail with a canned message.
Possible teardowns will nevertheless be executed.
See `Fail` if you only want to stop one test case unconditionally.
Definition at line 524 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.get_count | ( | self, | |
| container, | |||
| item | |||
| ) |
Returns and logs how many times item is found from container.
This keyword works with Python strings and lists and all objects
that either have ``count`` method or can be converted to Python lists.
Example:
| ${count} = | Get Count | ${some item} | interesting value |
| Should Be True | 5 < ${count} < 10 |
Definition at line 1266 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.get_length | ( | self, | |
| item | |||
| ) |
Returns and logs the length of the given item as an integer.
The item can be anything that has a length, for example, a string,
a list, or a mapping. The keyword first tries to get the length with
the Python function ``len``, which calls the item's ``__len__`` method
internally. If that fails, the keyword tries to call the item's
possible ``length`` and ``size`` methods directly. The final attempt is
trying to get the value of the item's ``length`` attribute. If all
these attempts are unsuccessful, the keyword fails.
Examples:
| ${length} = | Get Length | Hello, world! | |
| Should Be Equal As Integers | ${length} | 13 |
| @{list} = | Create List | Hello, | world! |
| ${length} = | Get Length | ${list} | |
| Should Be Equal As Integers | ${length} | 2 |
See also `Length Should Be`, `Should Be Empty` and `Should Not Be
Empty`.
Definition at line 1392 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.length_should_be | ( | self, | |
| item, | |||
| length, | |||
msg = None |
|||
| ) |
Verifies that the length of the given item is correct.
The length of the item is got using the `Get Length` keyword. The
default error message can be overridden with the ``msg`` argument.
Definition at line 1425 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_be_empty | ( | self, | |
| item, | |||
msg = None |
|||
| ) |
Verifies that the given item is empty.
The length of the item is got using the `Get Length` keyword. The
default error message can be overridden with the ``msg`` argument.
Definition at line 1437 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_be_equal | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
formatter = 'str', |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if the given objects are unequal.
Optional ``msg``, ``values`` and ``formatter`` arguments specify how
to construct the error message if this keyword fails:
- If ``msg`` is not given, the error message is ``<first> != <second>``.
- If ``msg`` is given and ``values`` gets a true value (default),
the error message is ``<msg>: <first> != <second>``.
- If ``msg`` is given and ``values`` gets a false value (see
`Boolean arguments`), the error message is simply ``<msg>``.
- ``formatter`` controls how to format the values. Possible values are
``str`` (default), ``repr`` and ``ascii``, and they work similarly
as Python built-in functions with same names. See `String
representations` for more details.
If ``ignore_case`` is given a true value (see `Boolean arguments`) and
both arguments are strings, comparison is done case-insensitively.
If both arguments are multiline strings, this keyword uses
`multiline string comparison`.
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
and both arguments are strings, the comparison is done without leading
and trailing spaces. If ``strip_spaces`` is given a string value
``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
without leading or trailing spaces, respectively.
If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both
arguments are strings, the comparison is done with all white spaces replaced by
a single space character.
Examples:
| Should Be Equal | ${x} | expected |
| Should Be Equal | ${x} | expected | Custom error message |
| Should Be Equal | ${x} | expected | Custom message | values=False |
| Should Be Equal | ${x} | expected | ignore_case=True | formatter=repr |
``strip_spaces`` is new in Robot Framework 4.0 and
``collapse_spaces`` is new in Robot Framework 4.1.
Definition at line 608 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_be_equal_as_integers | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
base = None |
|||
| ) |
Fails if objects are unequal after converting them to integers.
See `Convert To Integer` for information how to convert integers from
other bases than 10 using ``base`` argument or ``0b/0o/0x`` prefixes.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``.
Examples:
| Should Be Equal As Integers | 42 | ${42} | Error message |
| Should Be Equal As Integers | ABCD | abcd | base=16 |
| Should Be Equal As Integers | 0b1011 | 11 |
Definition at line 739 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_be_equal_as_numbers | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
precision = 6 |
|||
| ) |
Fails if objects are unequal after converting them to real numbers.
The conversion is done with `Convert To Number` keyword using the
given ``precision``.
Examples:
| Should Be Equal As Numbers | ${x} | 1.1 | | # Passes if ${x} is 1.1 |
| Should Be Equal As Numbers | 1.123 | 1.1 | precision=1 | # Passes |
| Should Be Equal As Numbers | 1.123 | 1.4 | precision=0 | # Passes |
| Should Be Equal As Numbers | 112.3 | 75 | precision=-2 | # Passes |
As discussed in the documentation of `Convert To Number`, machines
generally cannot store floating point numbers accurately. Because of
this limitation, comparing floats for equality is problematic and
a correct approach to use depends on the context. This keyword uses
a very naive approach of rounding the numbers before comparing them,
which is both prone to rounding errors and does not work very well if
numbers are really big or small. For more information about comparing
floats, and ideas on how to implement your own context specific
comparison algorithm, see
http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/.
If you want to avoid possible problems with floating point numbers,
you can implement custom keywords using Python's
[http://docs.python.org/library/decimal.html|decimal] or
[http://docs.python.org/library/fractions.html|fractions] modules.
See `Should Not Be Equal As Numbers` for a negative version of this
keyword and `Should Be Equal` for an explanation on how to override
the default error message with ``msg`` and ``values``.
Definition at line 794 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_be_equal_as_strings | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
formatter = 'str', |
|||
collapse_spaces = False |
|||
| ) |
Fails if objects are unequal after converting them to strings.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg``, ``values`` and ``formatter``.
If ``ignore_case`` is given a true value (see `Boolean arguments`),
comparison is done case-insensitively. If both arguments are
multiline strings, this keyword uses `multiline string comparison`.
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
and both arguments are strings, the comparison is done without leading
and trailing spaces. If ``strip_spaces`` is given a string value
``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
without leading or trailing spaces, respectively.
If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both
arguments are strings, the comparison is done with all white spaces replaced by
a single space character.
Strings are always [http://www.macchiato.com/unicode/nfc-faq| NFC normalized].
``strip_spaces`` is new in Robot Framework 4.0
and ``collapse_spaces`` is new in Robot Framework 4.1.
Definition at line 866 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_be_true | ( | self, | |
| condition, | |||
msg = None |
|||
| ) |
Fails if the given condition is not true.
If ``condition`` is a string (e.g. ``${rc} < 10``), it is evaluated as
a Python expression as explained in `Evaluating expressions` and the
keyword status is decided based on the result. If a non-string item is
given, the status is got directly from its
[http://docs.python.org/library/stdtypes.html#truth|truth value].
The default error message (``<condition> should be true``) is not very
informative, but it can be overridden with the ``msg`` argument.
Examples:
| Should Be True | ${rc} < 10 |
| Should Be True | '${status}' == 'PASS' | # Strings must be quoted |
| Should Be True | ${number} | # Passes if ${number} is not zero |
| Should Be True | ${list} | # Passes if ${list} is not empty |
Variables used like ``${variable}``, as in the examples above, are
replaced in the expression before evaluation. Variables are also
available in the evaluation namespace, and can be accessed using
special ``$variable`` syntax as explained in the `Evaluating
expressions` section.
Examples:
| Should Be True | $rc < 10 |
| Should Be True | $status == 'PASS' | # Expected string must be quoted |
Definition at line 565 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_contain | ( | self, | |
| container, | |||
| item, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if container does not contain item one or more times.
Works with strings, lists, and anything that supports Python's ``in``
operator.
See `Should Be Equal` for an explanation on how to override the default
error message with arguments ``msg`` and ``values``.
If ``ignore_case`` is given a true value (see `Boolean arguments`) and
compared items are strings, it indicates that comparison should be
case-insensitive. If the ``container`` is a list-like object, string
items in it are compared case-insensitively.
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
and both arguments are strings, the comparison is done without leading
and trailing spaces. If ``strip_spaces`` is given a string value
``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
without leading or trailing spaces, respectively.
If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both
arguments are strings, the comparison is done with all white spaces replaced by
a single space character.
Examples:
| Should Contain | ${output} | PASS |
| Should Contain | ${some list} | value | msg=Failure! | values=False |
| Should Contain | ${some list} | value | ignore_case=True |
``strip_spaces`` is new in Robot Framework 4.0 and ``collapse_spaces`` is new
in Robot Framework 4.1.
Definition at line 1057 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_contain_any | ( | self, | |
| container, | |||
| * | items, | ||
| ** | configuration | ||
| ) |
Fails if container does not contain any of the *items.
Works with strings, lists, and anything that supports Python's ``in``
operator.
Supports additional configuration parameters ``msg``, ``values``,
``ignore_case`` and ``strip_spaces``, and ``collapse_spaces``
which have exactly the same semantics as arguments with same
names have with `Should Contain`. These arguments must always
be given using ``name=value`` syntax after all ``items``.
Note that possible equal signs in ``items`` must be escaped with
a backslash (e.g. ``foo\\=bar``) to avoid them to be passed in
as ``**configuration``.
Examples:
| Should Contain Any | ${string} | substring 1 | substring 2 |
| Should Contain Any | ${list} | item 1 | item 2 | item 3 |
| Should Contain Any | ${list} | item 1 | item 2 | item 3 | ignore_case=True |
| Should Contain Any | ${list} | @{items} | msg=Custom message | values=False |
Definition at line 1103 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_contain_x_times | ( | self, | |
| container, | |||
| item, | |||
| count, | |||
msg = None, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if container does not contain item count times.
Works with strings, lists and all objects that `Get Count` works
with. The default error message can be overridden with ``msg`` and
the actual count is always logged.
If ``ignore_case`` is given a true value (see `Boolean arguments`) and
compared items are strings, it indicates that comparison should be
case-insensitive. If the ``container`` is a list-like object, string
items in it are compared case-insensitively.
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
and both arguments are strings, the comparison is done without leading
and trailing spaces. If ``strip_spaces`` is given a string value
``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
without leading or trailing spaces, respectively.
If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both
arguments are strings, the comparison is done with all white spaces replaced by
a single space character.
Examples:
| Should Contain X Times | ${output} | hello | 2 |
| Should Contain X Times | ${some list} | value | 3 | ignore_case=True |
``strip_spaces`` is new in Robot Framework 4.0 and ``collapse_spaces`` is new
in Robot Framework 4.1.
Definition at line 1227 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_end_with | ( | self, | |
| str1, | |||
| str2, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if the string str1 does not end with the string str2.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``, as well as for semantics
of the ``ignore_case``, ``strip_spaces``, and ``collapse_spaces`` options.
Definition at line 954 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_match | ( | self, | |
| string, | |||
| pattern, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False |
|||
| ) |
Fails if the given string does not match the given pattern.
Pattern matching is similar as matching files in a shell with
``*``, ``?`` and ``[chars]`` acting as wildcards. See the
`Glob patterns` section for more information.
If ``ignore_case`` is given a true value (see `Boolean arguments`) and
compared items are strings, it indicates that comparison should be
case-insensitive.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``.
Definition at line 1308 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_match_regexp | ( | self, | |
| string, | |||
| pattern, | |||
msg = None, |
|||
values = True, |
|||
flags = None |
|||
| ) |
Fails if string does not match pattern as a regular expression.
See the `Regular expressions` section for more information about
regular expressions and how to use then in Robot Framework test data.
Notice that the given pattern does not need to match the whole string.
For example, the pattern ``ello`` matches the string ``Hello world!``.
If a full match is needed, the ``^`` and ``$`` characters can be used
to denote the beginning and end of the string, respectively.
For example, ``^ello$`` only matches the exact string ``ello``.
Possible flags altering how the expression is parsed (e.g. ``re.IGNORECASE``,
``re.MULTILINE``) can be given using the ``flags`` argument (e.g.
``flags=IGNORECASE | MULTILINE``) or embedded to the pattern (e.g.
``(?im)pattern``).
If this keyword passes, it returns the portion of the string that
matched the pattern. Additionally, the possible captured groups are
returned.
See the `Should Be Equal` keyword for an explanation on how to override
the default error message with the ``msg`` and ``values`` arguments.
Examples:
| Should Match Regexp | ${output} | \\\\d{6} | # Output contains six numbers |
| Should Match Regexp | ${output} | ^\\\\d{6}$ | # Six numbers and nothing more |
| ${ret} = | Should Match Regexp | Foo: 42 | foo: \\\\d+ | flags=IGNORECASE |
| ${ret} = | Should Match Regexp | Foo: 42 | (?i)foo: \\\\d+ |
| ${match} | ${group1} | ${group2} = |
| ... | Should Match Regexp | Bar: 43 | (Foo|Bar): (\\\\d+) |
=>
| ${ret} = 'Foo: 42'
| ${match} = 'Bar: 43'
| ${group1} = 'Bar'
| ${group2} = '43'
The ``flags`` argument is new in Robot Framework 6.0.
Definition at line 1352 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_be_empty | ( | self, | |
| item, | |||
msg = None |
|||
| ) |
Verifies that the given item is not empty.
The length of the item is got using the `Get Length` keyword. The
default error message can be overridden with the ``msg`` argument.
Definition at line 1446 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_be_equal | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if the given objects are equal.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``.
If ``ignore_case`` is given a true value (see `Boolean arguments`) and
both arguments are strings, comparison is done case-insensitively.
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
and both arguments are strings, the comparison is done without leading
and trailing spaces. If ``strip_spaces`` is given a string value
``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
without leading or trailing spaces, respectively.
If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both
arguments are strings, the comparison is done with all white spaces replaced by
a single space character.
``strip_spaces`` is new in Robot Framework 4.0 and ``collapse_spaces`` is new
in Robot Framework 4.1.
Definition at line 690 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_be_equal_as_integers | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
base = None |
|||
| ) |
Fails if objects are equal after converting them to integers.
See `Convert To Integer` for information how to convert integers from
other bases than 10 using ``base`` argument or ``0b/0o/0x`` prefixes.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``.
See `Should Be Equal As Integers` for some usage examples.
Definition at line 719 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_be_equal_as_numbers | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
precision = 6 |
|||
| ) |
Fails if objects are equal after converting them to real numbers.
The conversion is done with `Convert To Number` keyword using the
given ``precision``.
See `Should Be Equal As Numbers` for examples on how to use
``precision`` and why it does not always work as expected. See also
`Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``.
Definition at line 756 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_be_equal_as_strings | ( | self, | |
| first, | |||
| second, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if objects are equal after converting them to strings.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``.
If ``ignore_case`` is given a true value (see `Boolean arguments`),
comparison is done case-insensitively.
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
and both arguments are strings, the comparison is done without leading
and trailing spaces. If ``strip_spaces`` is given a string value
``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
without leading or trailing spaces, respectively.
If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both
arguments are strings, the comparison is done with all white spaces replaced by
a single space character.
Strings are always [http://www.macchiato.com/unicode/nfc-faq|
NFC normalized].
``strip_spaces`` is new in Robot Framework 4.0 and ``collapse_spaces`` is new
in Robot Framework 4.1.
Definition at line 825 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_be_true | ( | self, | |
| condition, | |||
msg = None |
|||
| ) |
Fails if the given condition is true.
See `Should Be True` for details about how ``condition`` is evaluated
and how ``msg`` can be used to override the default error message.
Definition at line 534 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_contain | ( | self, | |
| container, | |||
| item, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if container contains item one or more times.
Works with strings, lists, and anything that supports Python's ``in``
operator.
See `Should Be Equal` for an explanation on how to override the default
error message with arguments ``msg`` and ``values``. ``ignore_case``
has exactly the same semantics as with `Should Contain`.
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
and both arguments are strings, the comparison is done without leading
and trailing spaces. If ``strip_spaces`` is given a string value
``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
without leading or trailing spaces, respectively.
If ``collapse_spaces`` is given a true value (see `Boolean arguments`) and both
arguments are strings, the comparison is done with all white spaces replaced by
a single space character.
Examples:
| Should Not Contain | ${some list} | value |
| Should Not Contain | ${output} | FAILED | ignore_case=True |
``strip_spaces`` is new in Robot Framework 4.0 and ``collapse_spaces`` is new
in Robot Framework 4.1.
Definition at line 995 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_contain_any | ( | self, | |
| container, | |||
| * | items, | ||
| ** | configuration | ||
| ) |
Fails if container contains one or more of the *items.
Works with strings, lists, and anything that supports Python's ``in``
operator.
Supports additional configuration parameters ``msg``, ``values``,
``ignore_case`` and ``strip_spaces``, and ``collapse_spaces`` which have exactly
the same semantics as arguments with same names have with `Should Contain`.
These arguments must always be given using ``name=value`` syntax after all ``items``.
Note that possible equal signs in ``items`` must be escaped with
a backslash (e.g. ``foo\\=bar``) to avoid them to be passed in
as ``**configuration``.
Examples:
| Should Not Contain Any | ${string} | substring 1 | substring 2 |
| Should Not Contain Any | ${list} | item 1 | item 2 | item 3 |
| Should Not Contain Any | ${list} | item 1 | item 2 | item 3 | ignore_case=True |
| Should Not Contain Any | ${list} | @{items} | msg=Custom message | values=False |
Definition at line 1161 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_end_with | ( | self, | |
| str1, | |||
| str2, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if the string str1 ends with the string str2.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``, as well as for semantics
of the ``ignore_case``, ``strip_spaces``, and ``collapse_spaces`` options.
Definition at line 932 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_match | ( | self, | |
| string, | |||
| pattern, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False |
|||
| ) |
Fails if the given string matches the given pattern.
Pattern matching is similar as matching files in a shell with
``*``, ``?`` and ``[chars]`` acting as wildcards. See the
`Glob patterns` section for more information.
If ``ignore_case`` is given a true value (see `Boolean arguments`),
the comparison is case-insensitive.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values`.
Definition at line 1289 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_match_regexp | ( | self, | |
| string, | |||
| pattern, | |||
msg = None, |
|||
values = True, |
|||
flags = None |
|||
| ) |
Fails if string matches pattern as a regular expression.
See `Should Match Regexp` for more information about arguments.
Definition at line 1367 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_not_start_with | ( | self, | |
| str1, | |||
| str2, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if the string str1 starts with the string str2.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``, as well as for semantics
of the ``ignore_case``, ``strip_spaces``, and ``collapse_spaces`` options.
Definition at line 889 of file BuiltIn.py.
| def robot.libraries.BuiltIn._Verify.should_start_with | ( | self, | |
| str1, | |||
| str2, | |||
msg = None, |
|||
values = True, |
|||
ignore_case = False, |
|||
strip_spaces = False, |
|||
collapse_spaces = False |
|||
| ) |
Fails if the string str1 does not start with the string str2.
See `Should Be Equal` for an explanation on how to override the default
error message with ``msg`` and ``values``, as well as for semantics
of the ``ignore_case``, ``strip_spaces``, and ``collapse_spaces`` options.
Definition at line 911 of file BuiltIn.py.