예제 #1
0
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
예제 #2
0
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
예제 #3
0
 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))
예제 #4
0
 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))