def equals_items(self, item1, item2):
"""Compare 2 items of type string or numeric.
:param item1: The string or numeric to compare
:param item2: The string or numeric to be compared with
:returns: (bool) whether the 2 items are equals or not
"""
if isinstance(item1, (text_type, binary_type)) is True:
return self.equals_strings(item1, item2)
if type(item1) is float or type(item2) is float:
if round(item1, 4) != round(item2, 4):
if self._verbose is True:
logging.info('Float values rounded to 4 digits are not equals: {:0.4f} != {:0.4f}'.format(item1, item2))
return False
return True
if item1 != item2:
if self._verbose is True:
logging.info('Not equals: {0} {1}'.format(item1, item2))
return False
return True