def isEquivalentData(values1, values2): """ Determines if two values are equivalent :param Iterable/object values1, values2: :return bool: """ if cell_types.isStr(values1) and cell_types.isStr(values2): result = values1 == values2 elif isinstance(values1, collections.Iterable) \ and isinstance(values2, collections.Iterable): result = compareIterables(values1, values2) elif type(values1) != type(values2): return False else: result = values1 == values2 return result
def testIsStr(self): self.assertTrue(cell_types.isStr("a")) self.assertTrue(cell_types.isStr(u"a")) self.assertTrue(cell_types.isStr(u"1")) self.assertFalse(cell_types.isStr(1))
def testIsStr(self): self.assertTrue(cell_types.isStr('a')) self.assertTrue(cell_types.isStr(u'a')) self.assertTrue(cell_types.isStr(u'1')) self.assertFalse(cell_types.isStr(1))