@@ -621,18 +621,17 @@ def should_be_equal(self, first, second, msg=None, values=True,
621
621
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
622
622
and both arguments are strings, the comparison is done without leading
623
623
and trailing spaces. If ``strip_spaces`` is given a string value
624
- ``leading`` or ``trailing`` and both arguments are strings, the
625
- comparison is done without leading or trailing spaces respectively.
626
- The default value is ``False``.
624
+ ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
625
+ without leading or trailing spaces, respectively.
627
626
628
627
Examples:
629
628
| Should Be Equal | ${x} | expected |
630
629
| Should Be Equal | ${x} | expected | Custom error message |
631
630
| Should Be Equal | ${x} | expected | Custom message | values=False |
632
631
| Should Be Equal | ${x} | expected | ignore_case=True | formatter=repr |
633
632
634
- ``ignore_case`` and `` formatter`` are new features in Robot Framework
635
- 3.0.1 and 3.1.2, respectively .
633
+ ``formatter`` is new in Robot Framework 3.1.2 and ``strip_spaces`` is new
634
+ in Robot Framework 4.0 .
636
635
"""
637
636
self ._log_types_at_info_if_different (first , second )
638
637
if is_truthy (ignore_case ) and is_string (first ) and is_string (second ):
@@ -698,11 +697,10 @@ def should_not_be_equal(self, first, second, msg=None, values=True,
698
697
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
699
698
and both arguments are strings, the comparison is done without leading
700
699
and trailing spaces. If ``strip_spaces`` is given a string value
701
- ``leading`` or ``trailing`` and both arguments are strings, the
702
- comparison is done without leading or trailing spaces respectively.
703
- The default value is ``False``.
700
+ ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
701
+ without leading or trailing spaces, respectively.
704
702
705
- New option in Robot Framework 3.0.1 .
703
+ ``strip_spaces`` is new in Robot Framework 4.0 .
706
704
"""
707
705
self ._log_types_at_info_if_different (first , second )
708
706
if is_truthy (ignore_case ) and is_string (first ) and is_string (second ):
@@ -821,14 +819,13 @@ def should_not_be_equal_as_strings(self, first, second, msg=None,
821
819
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
822
820
and both arguments are strings, the comparison is done without leading
823
821
and trailing spaces. If ``strip_spaces`` is given a string value
824
- ``leading`` or ``trailing`` and both arguments are strings, the
825
- comparison is done without leading or trailing spaces respectively.
826
- The default value is ``False``.
822
+ ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
823
+ without leading or trailing spaces, respectively.
827
824
828
825
Strings are always [http://www.macchiato.com/unicode/nfc-faq|
829
826
NFC normalized].
830
827
831
- ``ignore_case `` is a new feature in Robot Framework 3.0.1 .
828
+ ``strip_spaces `` is new in Robot Framework 4.0 .
832
829
"""
833
830
self ._log_types_at_info_if_different (first , second )
834
831
first = self ._convert_to_string (first )
@@ -855,15 +852,14 @@ def should_be_equal_as_strings(self, first, second, msg=None, values=True,
855
852
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
856
853
and both arguments are strings, the comparison is done without leading
857
854
and trailing spaces. If ``strip_spaces`` is given a string value
858
- ``leading`` or ``trailing`` and both arguments are strings, the
859
- comparison is done without leading or trailing spaces respectively.
860
- The default value is ``False``.
855
+ ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
856
+ without leading or trailing spaces, respectively.
861
857
862
858
Strings are always [http://www.macchiato.com/unicode/nfc-faq|
863
859
NFC normalized].
864
860
865
- ``ignore_case`` and `` formatter`` are new features in Robot Framework
866
- 3.0.1 and 3.1.2, respectively .
861
+ ``formatter`` is new in Robot Framework 3.1.2 and ``strip_spaces`` is new
862
+ in Robot Framework 4.0 .
867
863
"""
868
864
self ._log_types_at_info_if_different (first , second )
869
865
first = self ._convert_to_string (first )
@@ -963,13 +959,14 @@ def should_not_contain(self, container, item, msg=None, values=True,
963
959
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
964
960
and both arguments are strings, the comparison is done without leading
965
961
and trailing spaces. If ``strip_spaces`` is given a string value
966
- ``leading`` or ``trailing`` and both arguments are strings, the
967
- comparison is done without leading or trailing spaces respectively.
968
- The default value is ``False``.
962
+ ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
963
+ without leading or trailing spaces, respectively.
969
964
970
965
Examples:
971
966
| Should Not Contain | ${some list} | value |
972
967
| Should Not Contain | ${output} | FAILED | ignore_case=True |
968
+
969
+ ``strip_spaces`` is new in Robot Framework 4.0.
973
970
"""
974
971
# TODO: It is inconsistent that errors show original case in 'container'
975
972
# 'item' is in lower case. Should rather show original case everywhere
@@ -1006,20 +1003,20 @@ def should_contain(self, container, item, msg=None, values=True,
1006
1003
If ``ignore_case`` is given a true value (see `Boolean arguments`) and
1007
1004
compared items are strings, it indicates that comparison should be
1008
1005
case-insensitive. If the ``container`` is a list-like object, string
1009
- items in it are compared case-insensitively. New option in Robot
1010
- Framework 3.0.1.
1006
+ items in it are compared case-insensitively.
1011
1007
1012
1008
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
1013
1009
and both arguments are strings, the comparison is done without leading
1014
1010
and trailing spaces. If ``strip_spaces`` is given a string value
1015
- ``leading`` or ``trailing`` and both arguments are strings, the
1016
- comparison is done without leading or trailing spaces respectively.
1017
- The default value is ``False``.
1011
+ ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
1012
+ without leading or trailing spaces, respectively.
1018
1013
1019
1014
Examples:
1020
1015
| Should Contain | ${output} | PASS |
1021
1016
| Should Contain | ${some list} | value | msg=Failure! | values=False |
1022
1017
| Should Contain | ${some list} | value | ignore_case=True |
1018
+
1019
+ ``strip_spaces`` is new in Robot Framework 4.0.
1023
1020
"""
1024
1021
orig_container = container
1025
1022
if is_truthy (ignore_case ) and is_string (item ):
@@ -1059,8 +1056,6 @@ def should_contain_any(self, container, *items, **configuration):
1059
1056
| Should Contain Any | ${list} | item 1 | item 2 | item 3 |
1060
1057
| Should Contain Any | ${list} | item 1 | item 2 | item 3 | ignore_case=True |
1061
1058
| Should Contain Any | ${list} | @{items} | msg=Custom message | values=False |
1062
-
1063
- New in Robot Framework 3.0.1.
1064
1059
"""
1065
1060
msg = configuration .pop ('msg' , None )
1066
1061
values = configuration .pop ('values' , True )
@@ -1114,8 +1109,6 @@ def should_not_contain_any(self, container, *items, **configuration):
1114
1109
| Should Not Contain Any | ${list} | item 1 | item 2 | item 3 |
1115
1110
| Should Not Contain Any | ${list} | item 1 | item 2 | item 3 | ignore_case=True |
1116
1111
| Should Not Contain Any | ${list} | @{items} | msg=Custom message | values=False |
1117
-
1118
- New in Robot Framework 3.0.1.
1119
1112
"""
1120
1113
msg = configuration .pop ('msg' , None )
1121
1114
values = configuration .pop ('values' , True )
@@ -1158,22 +1151,20 @@ def should_contain_x_times(self, container, item, count, msg=None,
1158
1151
1159
1152
If ``ignore_case`` is given a true value (see `Boolean arguments`) and
1160
1153
compared items are strings, it indicates that comparison should be
1161
- case-insensitive.
1154
+ case-insensitive. If the ``container`` is a list-like object, string
1155
+ items in it are compared case-insensitively.
1162
1156
1163
1157
If ``strip_spaces`` is given a true value (see `Boolean arguments`)
1164
1158
and both arguments are strings, the comparison is done without leading
1165
1159
and trailing spaces. If ``strip_spaces`` is given a string value
1166
- ``leading`` or ``trailing`` and both arguments are strings, the
1167
- comparison is done without leading or trailing spaces respectively.
1168
- The default value is ``False``.
1169
-
1170
- If the ``container`` is a list-like object, string
1171
- items in it are compared case-insensitively. New option in Robot
1172
- Framework 3.0.1.
1160
+ ``LEADING`` or ``TRAILING`` (case-insensitive), the comparison is done
1161
+ without leading or trailing spaces, respectively.
1173
1162
1174
1163
Examples:
1175
1164
| Should Contain X Times | ${output} | hello | 2 |
1176
1165
| Should Contain X Times | ${some list} | value | 3 | ignore_case=True |
1166
+
1167
+ ``strip_spaces`` is new in Robot Framework 4.0.
1177
1168
"""
1178
1169
count = self ._convert_to_integer (count )
1179
1170
orig_container = container
@@ -1223,13 +1214,11 @@ def should_not_match(self, string, pattern, msg=None, values=True,
1223
1214
``*``, ``?`` and ``[chars]`` acting as wildcards. See the
1224
1215
`Glob patterns` section for more information.
1225
1216
1226
- If ``ignore_case`` is given a true value (see `Boolean arguments`) and
1227
- compared items are strings, it indicates that comparison should be
1228
- case-insensitive.
1217
+ If ``ignore_case`` is given a true value (see `Boolean arguments`),
1218
+ the comparison is case-insensitive.
1229
1219
1230
1220
See `Should Be Equal` for an explanation on how to override the default
1231
- error message with ``msg`` and ``values``, as well as for semantics
1232
- of the ``ignore_case`` option.
1221
+ error message with ``msg`` and ``values`.
1233
1222
"""
1234
1223
if self ._matches (string , pattern , caseless = is_truthy (ignore_case )):
1235
1224
raise AssertionError (self ._get_string_msg (string , pattern , msg ,
@@ -1248,8 +1237,7 @@ def should_match(self, string, pattern, msg=None, values=True,
1248
1237
case-insensitive.
1249
1238
1250
1239
See `Should Be Equal` for an explanation on how to override the default
1251
- error message with ``msg`` and ``values``, as well as for semantics
1252
- of the ``ignore_case`` option.
1240
+ error message with ``msg`` and ``values``.
1253
1241
"""
1254
1242
if not self ._matches (string , pattern , caseless = is_truthy (ignore_case )):
1255
1243
raise AssertionError (self ._get_string_msg (string , pattern , msg ,
@@ -1620,7 +1608,7 @@ def set_task_variable(self, name, *values):
1620
1608
"""Makes a variable available everywhere within the scope of the current task.
1621
1609
1622
1610
This is an alias for `Set Test Variable` that is more applicable when
1623
- creating tasks, not tests. New in RF 3.1.
1611
+ creating tasks, not tests. New in Robot Framework 3.1.
1624
1612
"""
1625
1613
self .set_test_variable (name , * values )
1626
1614
@@ -2131,8 +2119,6 @@ def repeat_keyword(self, repeat, name, *args):
2131
2119
| Repeat Keyword | 5 times | Go to Previous Page |
2132
2120
| Repeat Keyword | ${var} | Some Keyword | arg1 | arg2 |
2133
2121
| Repeat Keyword | 2 minutes | Some Keyword | arg1 | arg2 |
2134
-
2135
- Specifying ``repeat`` as a timeout is new in Robot Framework 3.0.
2136
2122
"""
2137
2123
try :
2138
2124
count = self ._get_repeat_count (repeat )
@@ -3567,8 +3553,7 @@ class BuiltIn(_Verify, _Converter, _Variables, _RunKeyword, _Control, _Misc):
3567
3553
| `Should Be Equal` | ${x} | ${y} | Custom error | values=${FALSE} | # Python ``False`` is false. |
3568
3554
| `Should Be Equal` | ${x} | ${y} | Custom error | values=no values | # ``no values`` works with ``values`` argument |
3569
3555
3570
- Considering string ``NONE`` false is new in Robot Framework 3.0.3 and
3571
- considering also ``OFF`` and ``0`` false is new in Robot Framework 3.1.
3556
+ Considering strings ``OFF`` and ``0`` false is new in Robot Framework 3.1.
3572
3557
3573
3558
= Pattern matching =
3574
3559
0 commit comments