Exemplo n.º 1
0
 def testNetedLists(self):
     values = [n + 0.01 for n in RANGE]
     list_values = [values, values]
     new_list_values = roundValues(list_values, 1)
     for lst in new_list_values:
         self.assertTrue(list(lst), RANGE)
Exemplo n.º 2
0
 def testSimple(self):
     values = [n + 0.01 for n in RANGE]
     new_values = roundValues(values, 1)
     self.assertTrue(list(new_values) == RANGE)
     new_values = roundValues(values, 2)
     self.assertTrue(list(new_values) == list(values))
Exemplo n.º 3
0
 def test1(self):
   groups, values = groupBy([self.df['cat1']], self.df['cc'])
   self.assertTrue(set(groups) == set(CAT1))
   self.assertEqual(len(values), len(groups))
   self.assertTrue(list(roundValues(values[0])) == [0, 0.1, 0.4, 0.5])
   self.assertTrue(list(roundValues(values[1])) == [0.2, 0.3, 0.6, 0.7])
Exemplo n.º 4
0
 def test1(self):
     groups, values = groupBy([self.df['cat1']], self.df['cc'])
     self.assertTrue(set(groups) == set(CAT1))
     self.assertEqual(len(values), len(groups))
     self.assertTrue(list(roundValues(values[0])) == [0, 0.1, 0.4, 0.5])
     self.assertTrue(list(roundValues(values[1])) == [0.2, 0.3, 0.6, 0.7])
Exemplo n.º 5
0
 def testNetedLists(self):
   values = [n + 0.01 for n in RANGE]
   list_values = [values, values]
   new_list_values = roundValues(list_values, 1)
   for lst in new_list_values:
     self.assertTrue(list(lst), RANGE)
Exemplo n.º 6
0
 def testSimple(self):
   values = [n + 0.01 for n in RANGE]
   new_values = roundValues(values, 1)
   self.assertTrue(list(new_values) == RANGE)
   new_values = roundValues(values, 2)
   self.assertTrue(list(new_values) == list(values))