Robot Framework
Collections.py
Go to the documentation of this file.
1 # Copyright 2008-2015 Nokia Networks
2 # Copyright 2016- Robot Framework Foundation
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 
16 import copy
17 
18 from robot.api import logger
19 from robot.utils import (is_dict_like, is_list_like, is_string, is_truthy, Matcher,
20  plural_or_not as s, seq2str, seq2str2, type_name)
21 from robot.utils.asserts import assert_equal
22 from robot.version import get_version
23 
24 
25 class NotSet:
26  def __repr__(self):
27  return ""
28 
29 
30 NOT_SET = NotSet()
31 
32 
33 class _List:
34 
35 
40  def convert_to_list(self, item):
41  return list(item)
42 
43 
52  def append_to_list(self, list_, *values):
53  self._validate_list_validate_list(list_)
54  for value in values:
55  list_.append(value)
56 
57 
77  def insert_into_list(self, list_, index, value):
78  self._validate_list_validate_list(list_)
79  list_.insert(self._index_to_int_index_to_int(index), value)
80 
81 
93  def combine_lists(self, *lists):
94  self._validate_lists_validate_lists(*lists)
95  ret = []
96  for item in lists:
97  ret.extend(item)
98  return ret
99 
100 
114  def set_list_value(self, list_, index, value):
115  self._validate_list_validate_list(list_)
116  try:
117  list_[self._index_to_int_index_to_int(index)] = value
118  except IndexError:
119  self._index_error_index_error(list_, index)
120 
121 
130  def remove_values_from_list(self, list_, *values):
131  self._validate_list_validate_list(list_)
132  for value in values:
133  while value in list_:
134  list_.remove(value)
135 
136 
150  def remove_from_list(self, list_, index):
151  self._validate_list_validate_list(list_)
152  try:
153  return list_.pop(self._index_to_int_index_to_int(index))
154  except IndexError:
155  self._index_error_index_error(list_, index)
156 
157 
164  def remove_duplicates(self, list_):
165  self._validate_list_validate_list(list_)
166  ret = []
167  for item in list_:
168  if item not in ret:
169  ret.append(item)
170  removed = len(list_) - len(ret)
171  logger.info(f'{removed} duplicate{s(removed)} removed.')
172  return ret
173 
174 
192  def get_from_list(self, list_, index):
193  self._validate_list_validate_list(list_)
194  try:
195  return list_[self._index_to_int_index_to_int(index)]
196  except IndexError:
197  self._index_error_index_error(list_, index)
198 
199 
222  def get_slice_from_list(self, list_, start=0, end=None):
223  self._validate_list_validate_list(list_)
224  start = self._index_to_int_index_to_int(start, True)
225  if end is not None:
226  end = self._index_to_int_index_to_int(end)
227  return list_[start:end]
228 
229 
241  def count_values_in_list(self, list_, value, start=0, end=None):
242  self._validate_list_validate_list(list_)
243  return self.get_slice_from_listget_slice_from_list(list_, start, end).count(value)
244 
245 
258  def get_index_from_list(self, list_, value, start=0, end=None):
259  self._validate_list_validate_list(list_)
260  if start == '':
261  start = 0
262  list_ = self.get_slice_from_listget_slice_from_list(list_, start, end)
263  try:
264  return int(start) + list_.index(value)
265  except ValueError:
266  return -1
267 
268 
275  def copy_list(self, list_, deepcopy=False):
276  self._validate_list_validate_list(list_)
277  if deepcopy:
278  return copy.deepcopy(list_)
279  return list_[:]
280 
281 
290  def reverse_list(self, list_):
291  self._validate_list_validate_list(list_)
292  list_.reverse()
293 
294 
303  def sort_list(self, list_):
304  self._validate_list_validate_list(list_)
305  list_.sort()
306 
307 
311  def list_should_contain_value(self, list_, value, msg=None):
312  self._validate_list_validate_list(list_)
313  _verify_condition(value in list_,
314  f"{seq2str2(list_)} does not contain value '{value}'.",
315  msg)
316 
317 
321  def list_should_not_contain_value(self, list_, value, msg=None):
322  self._validate_list_validate_list(list_)
323  _verify_condition(value not in list_,
324  f"{seq2str2(list_)} contains value '{value}'.",
325  msg)
326 
327 
337  def list_should_not_contain_duplicates(self, list_, msg=None):
338  self._validate_list_validate_list(list_)
339  if not isinstance(list_, list):
340  list_ = list(list_)
341  dupes = []
342  for item in list_:
343  if item not in dupes:
344  count = list_.count(item)
345  if count > 1:
346  logger.info(f"'{item}' found {count} times.")
347  dupes.append(item)
348  if dupes:
349  raise AssertionError(msg or f'{seq2str(dupes)} found multiple times.')
350 
351 
394  def lists_should_be_equal(self, list1, list2, msg=None, values=True,
395  names=None, ignore_order=False):
396  self._validate_lists_validate_lists(list1, list2)
397  len1 = len(list1)
398  len2 = len(list2)
399  _verify_condition(len1 == len2,
400  f'Lengths are different: {len1} != {len2}',
401  msg, values)
402  names = self._get_list_index_name_mapping_get_list_index_name_mapping(names, len1)
403  if ignore_order:
404  list1 = sorted(list1)
405  list2 = sorted(list2)
406  diffs = '\n'.join(self._yield_list_diffs_yield_list_diffs(list1, list2, names))
407  _verify_condition(not diffs,
408  f'Lists are different:\n{diffs}',
409  msg, values)
410 
411  def _get_list_index_name_mapping(self, names, list_length):
412  if not names:
413  return {}
414  if is_dict_like(names):
415  return dict((int(index), names[index]) for index in names)
416  return dict(zip(range(list_length), names))
417 
418  def _yield_list_diffs(self, list1, list2, names):
419  for index, (item1, item2) in enumerate(zip(list1, list2)):
420  name = f' ({names[index]})' if index in names else ''
421  try:
422  assert_equal(item1, item2, msg=f'Index {index}{name}')
423  except AssertionError as err:
424  yield str(err)
425 
426 
434  def list_should_contain_sub_list(self, list1, list2, msg=None, values=True):
435  self._validate_lists_validate_lists(list1, list2)
436  diffs = ', '.join(str(item) for item in list2 if item not in list1)
437  _verify_condition(not diffs,
438  f'Following values were not found from first list: {diffs}',
439  msg, values)
440 
441 
448  def log_list(self, list_, level='INFO'):
449  self._validate_list_validate_list(list_)
450  logger.write('\n'.join(self._log_list_log_list(list_)), level)
451 
452  def _log_list(self, list_):
453  if not list_:
454  yield 'List is empty.'
455  elif len(list_) == 1:
456  yield f'List has one item:\n{list_[0]}'
457  else:
458  yield f'List length is {len(list_)} and it contains following items:'
459  for index, item in enumerate(list_):
460  yield f'{index}: {item}'
461 
462  def _index_to_int(self, index, empty_to_zero=False):
463  if empty_to_zero and not index:
464  return 0
465  try:
466  return int(index)
467  except ValueError:
468  raise ValueError(f"Cannot convert index '{index}' to an integer.")
469 
470  def _index_error(self, list_, index):
471  raise IndexError(f'Given index {index} is out of the range 0-{len(list_)-1}.')
472 
473  def _validate_list(self, list_, position=1):
474  if not is_list_like(list_):
475  raise TypeError(f"Expected argument {position} to be a list or list-like, "
476  f"got {type_name(list_)} instead.")
477 
478  def _validate_lists(self, *lists):
479  for index, item in enumerate(lists, start=1):
480  self._validate_list_validate_list(item, index)
481 
482 
484 
485 
494  def convert_to_dictionary(self, item):
495  return dict(item)
496 
497 
513  def set_to_dictionary(self, dictionary, *key_value_pairs, **items):
514  self._validate_dictionary_validate_dictionary(dictionary)
515  if len(key_value_pairs) % 2 != 0:
516  raise ValueError("Adding data to a dictionary failed. There "
517  "should be even number of key-value-pairs.")
518  for i in range(0, len(key_value_pairs), 2):
519  dictionary[key_value_pairs[i]] = key_value_pairs[i+1]
520  dictionary.update(items)
521  return dictionary
522 
523 
533  def remove_from_dictionary(self, dictionary, *keys):
534  self._validate_dictionary_validate_dictionary(dictionary)
535  for key in keys:
536  if key in dictionary:
537  value = dictionary.pop(key)
538  logger.info(f"Removed item with key '{key}' and value '{value}'.")
539  else:
540  logger.info(f"Key '{key}' not found.")
541 
542 
554  def pop_from_dictionary(self, dictionary, key, default=NOT_SET):
555  self._validate_dictionary_validate_dictionary(dictionary)
556  if default is NOT_SET:
557  self.dictionary_should_contain_keydictionary_should_contain_key(dictionary, key)
558  return dictionary.pop(key)
559  return dictionary.pop(key, default)
560 
561 
571  def keep_in_dictionary(self, dictionary, *keys):
572  self._validate_dictionary_validate_dictionary(dictionary)
573  remove_keys = [k for k in dictionary if k not in keys]
574  self.remove_from_dictionaryremove_from_dictionary(dictionary, *remove_keys)
575 
576 
587  def copy_dictionary(self, dictionary, deepcopy=False):
588  self._validate_dictionary_validate_dictionary(dictionary)
589  if deepcopy:
590  return copy.deepcopy(dictionary)
591  return dictionary.copy()
592 
593 
613  def get_dictionary_keys(self, dictionary, sort_keys=True):
614  self._validate_dictionary_validate_dictionary(dictionary)
615  keys = dictionary.keys()
616  if sort_keys:
617  try:
618  return sorted(keys)
619  except TypeError:
620  pass
621  return list(keys)
622 
623 
643  def get_dictionary_values(self, dictionary, sort_keys=True):
644  self._validate_dictionary_validate_dictionary(dictionary)
645  keys = self.get_dictionary_keysget_dictionary_keys(dictionary, sort_keys=sort_keys)
646  return [dictionary[k] for k in keys]
647 
648 
672  def get_dictionary_items(self, dictionary, sort_keys=True):
673  self._validate_dictionary_validate_dictionary(dictionary)
674  keys = self.get_dictionary_keysget_dictionary_keys(dictionary, sort_keys=sort_keys)
675  return [i for key in keys for i in (key, dictionary[key])]
676 
677 
692  def get_from_dictionary(self, dictionary, key, default=NOT_SET):
693  self._validate_dictionary_validate_dictionary(dictionary)
694  try:
695  return dictionary[key]
696  except KeyError:
697  if default is not NOT_SET:
698  return default
699  raise RuntimeError(f"Dictionary does not contain key '{key}'.")
700 
701 
705  def dictionary_should_contain_key(self, dictionary, key, msg=None):
706  self._validate_dictionary_validate_dictionary(dictionary)
707  _verify_condition(key in dictionary,
708  f"Dictionary does not contain key '{key}'.",
709  msg)
710 
711 
715  def dictionary_should_not_contain_key(self, dictionary, key, msg=None):
716  self._validate_dictionary_validate_dictionary(dictionary)
717  _verify_condition(key not in dictionary,
718  f"Dictionary contains key '{key}'.",
719  msg)
720 
721 
727  def dictionary_should_contain_item(self, dictionary, key, value, msg=None):
728  self._validate_dictionary_validate_dictionary(dictionary)
729  self.dictionary_should_contain_keydictionary_should_contain_key(dictionary, key, msg)
730  assert_equal(dictionary[key], value,
731  msg or f"Value of dictionary key '{key}' does not match",
732  values=not msg)
733 
734 
738  def dictionary_should_contain_value(self, dictionary, value, msg=None):
739  self._validate_dictionary_validate_dictionary(dictionary)
740  _verify_condition(value in dictionary.values(),
741  f"Dictionary does not contain value '{value}'.",
742  msg)
743 
744 
748  def dictionary_should_not_contain_value(self, dictionary, value, msg=None):
749  self._validate_dictionary_validate_dictionary(dictionary)
750  _verify_condition(value not in dictionary.values(),
751  f"Dictionary contains value '{value}'.",
752  msg)
753 
754 
764  def dictionaries_should_be_equal(self, dict1, dict2, msg=None, values=True):
765  self._validate_dictionary_validate_dictionary(dict1)
766  self._validate_dictionary_validate_dictionary(dict2, 2)
767  keys = self._keys_should_be_equal_keys_should_be_equal(dict1, dict2, msg, values)
768  self._key_values_should_be_equal_key_values_should_be_equal(keys, dict1, dict2, msg, values)
769 
770 
775  def dictionary_should_contain_sub_dictionary(self, dict1, dict2, msg=None,
776  values=True):
777  self._validate_dictionary_validate_dictionary(dict1)
778  self._validate_dictionary_validate_dictionary(dict2, 2)
779  keys = self.get_dictionary_keysget_dictionary_keys(dict2)
780  diffs = ', '.join(str(k) for k in keys if k not in dict1)
781  _verify_condition(not diffs,
782  f"Following keys missing from first dictionary: {diffs}",
783  msg, values)
784  self._key_values_should_be_equal_key_values_should_be_equal(keys, dict1, dict2, msg, values)
785 
786 
793  def log_dictionary(self, dictionary, level='INFO'):
794  self._validate_dictionary_validate_dictionary(dictionary)
795  logger.write('\n'.join(self._log_dictionary_log_dictionary(dictionary)), level)
796 
797  def _log_dictionary(self, dictionary):
798  if not dictionary:
799  yield 'Dictionary is empty.'
800  elif len(dictionary) == 1:
801  yield 'Dictionary has one item:'
802  else:
803  yield f'Dictionary size is {len(dictionary)} and it contains following items:'
804  for key in self.get_dictionary_keysget_dictionary_keys(dictionary):
805  yield f'{key}: {dictionary[key]}'
806 
807  def _keys_should_be_equal(self, dict1, dict2, msg, values):
808  keys1 = self.get_dictionary_keysget_dictionary_keys(dict1)
809  keys2 = self.get_dictionary_keysget_dictionary_keys(dict2)
810  miss1 = ', '.join(str(k) for k in keys2 if k not in dict1)
811  miss2 = ', '.join(str(k) for k in keys1 if k not in dict2)
812  error = []
813  if miss1:
814  error += [f'Following keys missing from first dictionary: {miss1}']
815  if miss2:
816  error += [f'Following keys missing from second dictionary: {miss2}']
817  _verify_condition(not error, '\n'.join(error), msg, values)
818  return keys1
819 
820  def _key_values_should_be_equal(self, keys, dict1, dict2, msg, values):
821  diffs = '\n'.join(self._yield_dict_diffs_yield_dict_diffs(keys, dict1, dict2))
822  _verify_condition(not diffs,
823  f'Following keys have different values:\n{diffs}',
824  msg, values)
825 
826  def _yield_dict_diffs(self, keys, dict1, dict2):
827  for key in keys:
828  try:
829  assert_equal(dict1[key], dict2[key], msg=f'Key {key}')
830  except AssertionError as err:
831  yield str(err)
832 
833  def _validate_dictionary(self, dictionary, position=1):
834  if not is_dict_like(dictionary):
835  raise TypeError(f"Expected argument {position} to be a dictionary or "
836  f"dictionary-like, got {type_name(dictionary)} instead.")
837 
838 
839 
918  ROBOT_LIBRARY_SCOPE = 'GLOBAL'
919  ROBOT_LIBRARY_VERSION = get_version()
920 
921 
956  def should_contain_match(self, list, pattern, msg=None,
957  case_insensitive=False,
958  whitespace_insensitive=False):
959  _List._validate_list(self, list)
960  matches = _get_matches_in_iterable(list, pattern, case_insensitive,
961  whitespace_insensitive)
962  default = f"{seq2str2(list)} does not contain match for pattern '{pattern}'."
963  _verify_condition(matches, default, msg)
964 
965 
970  def should_not_contain_match(self, list, pattern, msg=None,
971  case_insensitive=False,
972  whitespace_insensitive=False):
973  _List._validate_list(self, list)
974  matches = _get_matches_in_iterable(list, pattern, case_insensitive,
975  whitespace_insensitive)
976  default = f"{seq2str2(list)} contains match for pattern '{pattern}'."
977  _verify_condition(not matches, default, msg)
978 
979 
989  def get_matches(self, list, pattern, case_insensitive=False,
990  whitespace_insensitive=False):
991  _List._validate_list(self, list)
992  return _get_matches_in_iterable(list, pattern, case_insensitive,
993  whitespace_insensitive)
994 
995 
1005  def get_match_count(self, list, pattern, case_insensitive=False,
1006  whitespace_insensitive=False):
1007  _List._validate_list(self, list)
1008  return len(self.get_matchesget_matches(list, pattern, case_insensitive,
1009  whitespace_insensitive))
1010 
1011 
1012 def _verify_condition(condition, default_msg, msg, values=False):
1013  if condition:
1014  return
1015  if not msg:
1016  msg = default_msg
1017  elif is_truthy(values) and str(values).upper() != 'NO VALUES':
1018  msg += '\n' + default_msg
1019  raise AssertionError(msg)
1020 
1021 
1022 def _get_matches_in_iterable(iterable, pattern, case_insensitive=False,
1023  whitespace_insensitive=False):
1024  if not is_string(pattern):
1025  raise TypeError(f"Pattern must be string, got '{type_name(pattern)}'.")
1026  regexp = False
1027  if pattern.startswith('regexp='):
1028  pattern = pattern[7:]
1029  regexp = True
1030  elif pattern.startswith('glob='):
1031  pattern = pattern[5:]
1032  matcher = Matcher(pattern,
1033  caseless=is_truthy(case_insensitive),
1034  spaceless=is_truthy(whitespace_insensitive),
1035  regexp=regexp)
1036  return [string for string in iterable
1037  if is_string(string) and matcher.match(string)]
A library providing keywords for handling lists and dictionaries.
Definition: Collections.py:917
def should_not_contain_match(self, list, pattern, msg=None, case_insensitive=False, whitespace_insensitive=False)
Fails if pattern is found in list.
Definition: Collections.py:972
def get_match_count(self, list, pattern, case_insensitive=False, whitespace_insensitive=False)
Returns the count of matches to pattern in list.
def get_matches(self, list, pattern, case_insensitive=False, whitespace_insensitive=False)
Returns a list of matches to pattern in list.
Definition: Collections.py:990
def should_contain_match(self, list, pattern, msg=None, case_insensitive=False, whitespace_insensitive=False)
Fails if pattern is not found in list.
Definition: Collections.py:958
def _log_dictionary(self, dictionary)
Definition: Collections.py:797
def convert_to_dictionary(self, item)
Converts the given item to a Python dict type.
Definition: Collections.py:494
def set_to_dictionary(self, dictionary, *key_value_pairs, **items)
Adds the given key_value_pairs and items to the dictionary.
Definition: Collections.py:513
def _validate_dictionary(self, dictionary, position=1)
Definition: Collections.py:833
def get_from_dictionary(self, dictionary, key, default=NOT_SET)
Returns a value from the given dictionary based on the given key.
Definition: Collections.py:692
def dictionary_should_contain_item(self, dictionary, key, value, msg=None)
An item of key / value must be found in a dictionary.
Definition: Collections.py:727
def copy_dictionary(self, dictionary, deepcopy=False)
Returns a copy of the given dictionary.
Definition: Collections.py:587
def _keys_should_be_equal(self, dict1, dict2, msg, values)
Definition: Collections.py:807
def log_dictionary(self, dictionary, level='INFO')
Logs the size and contents of the dictionary using given level.
Definition: Collections.py:793
def get_dictionary_keys(self, dictionary, sort_keys=True)
Returns keys of the given dictionary as a list.
Definition: Collections.py:613
def dictionary_should_contain_key(self, dictionary, key, msg=None)
Fails if key is not found from dictionary.
Definition: Collections.py:705
def _yield_dict_diffs(self, keys, dict1, dict2)
Definition: Collections.py:826
def dictionary_should_contain_value(self, dictionary, value, msg=None)
Fails if value is not found from dictionary.
Definition: Collections.py:738
def get_dictionary_values(self, dictionary, sort_keys=True)
Returns values of the given dictionary as a list.
Definition: Collections.py:643
def dictionaries_should_be_equal(self, dict1, dict2, msg=None, values=True)
Fails if the given dictionaries are not equal.
Definition: Collections.py:764
def dictionary_should_contain_sub_dictionary(self, dict1, dict2, msg=None, values=True)
Fails unless all items in dict2 are found from dict1.
Definition: Collections.py:776
def _key_values_should_be_equal(self, keys, dict1, dict2, msg, values)
Definition: Collections.py:820
def dictionary_should_not_contain_key(self, dictionary, key, msg=None)
Fails if key is found from dictionary.
Definition: Collections.py:715
def remove_from_dictionary(self, dictionary, *keys)
Removes the given keys from the dictionary.
Definition: Collections.py:533
def keep_in_dictionary(self, dictionary, *keys)
Keeps the given keys in the dictionary and removes all other.
Definition: Collections.py:571
def get_dictionary_items(self, dictionary, sort_keys=True)
Returns items of the given dictionary as a list.
Definition: Collections.py:672
def pop_from_dictionary(self, dictionary, key, default=NOT_SET)
Pops the given key from the dictionary and returns its value.
Definition: Collections.py:554
def dictionary_should_not_contain_value(self, dictionary, value, msg=None)
Fails if value is found from dictionary.
Definition: Collections.py:748
def log_list(self, list_, level='INFO')
Logs the length and contents of the list using given level.
Definition: Collections.py:448
def remove_duplicates(self, list_)
Returns a list without duplicates based on the given list.
Definition: Collections.py:164
def insert_into_list(self, list_, index, value)
Inserts value into list to the position specified with index.
Definition: Collections.py:77
def list_should_contain_sub_list(self, list1, list2, msg=None, values=True)
Fails if not all elements in list2 are found in list1.
Definition: Collections.py:434
def remove_values_from_list(self, list_, *values)
Removes all occurrences of given values from list.
Definition: Collections.py:130
def count_values_in_list(self, list_, value, start=0, end=None)
Returns the number of occurrences of the given value in list.
Definition: Collections.py:241
def _index_error(self, list_, index)
Definition: Collections.py:470
def list_should_not_contain_value(self, list_, value, msg=None)
Fails if the value is found from list.
Definition: Collections.py:321
def sort_list(self, list_)
Sorts the given list in place.
Definition: Collections.py:303
def _validate_list(self, list_, position=1)
Definition: Collections.py:473
def set_list_value(self, list_, index, value)
Sets the value of list specified by index to the given value.
Definition: Collections.py:114
def list_should_contain_value(self, list_, value, msg=None)
Fails if the value is not found from list.
Definition: Collections.py:311
def _yield_list_diffs(self, list1, list2, names)
Definition: Collections.py:418
def _get_list_index_name_mapping(self, names, list_length)
Definition: Collections.py:411
def lists_should_be_equal(self, list1, list2, msg=None, values=True, names=None, ignore_order=False)
Fails if given lists are unequal.
Definition: Collections.py:395
def get_slice_from_list(self, list_, start=0, end=None)
Returns a slice of the given list between start and end indexes.
Definition: Collections.py:222
def list_should_not_contain_duplicates(self, list_, msg=None)
Fails if any element in the list is found from it more than once.
Definition: Collections.py:337
def _index_to_int(self, index, empty_to_zero=False)
Definition: Collections.py:462
def get_from_list(self, list_, index)
Returns the value specified with an index from list.
Definition: Collections.py:192
def remove_from_list(self, list_, index)
Removes and returns the value specified with an index from list.
Definition: Collections.py:150
def convert_to_list(self, item)
Converts the given item to a Python list type.
Definition: Collections.py:40
def get_index_from_list(self, list_, value, start=0, end=None)
Returns the index of the first occurrence of the value on the list.
Definition: Collections.py:258
def append_to_list(self, list_, *values)
Adds values to the end of list.
Definition: Collections.py:52
def _validate_lists(self, *lists)
Definition: Collections.py:478
def copy_list(self, list_, deepcopy=False)
Returns a copy of the given list.
Definition: Collections.py:275
def reverse_list(self, list_)
Reverses the given list in place.
Definition: Collections.py:290
def combine_lists(self, *lists)
Combines the given lists together and returns the result.
Definition: Collections.py:93
def _verify_condition(condition, default_msg, msg, values=False)
def _get_matches_in_iterable(iterable, pattern, case_insensitive=False, whitespace_insensitive=False)
def assert_equal(first, second, msg=None, values=True, formatter=safe_str)
Fail if given objects are unequal as determined by the '==' operator.
Definition: asserts.py:185
def is_dict_like(item)
Definition: robottypes.py:72
def is_truthy(item)
Returns True or False depending on is the item considered true or not.
Definition: robottypes.py:162
def is_list_like(item)
Definition: robottypes.py:66
def get_version(naked=False)
Definition: version.py:24