Exemplo n.º 1
0
 def test_flipped_many(self):
     # totals[i] = expected compare distance for list of that size
     totals = { 1: 0, 
                2: 2,
                3: 4,
                4: 8,
                5: 12
     }
     for size in range(2, 5):
         a = [i for i in range(size)]
         b = reversed(a)
         self.assertEquals(compare_lists(a, b), totals[size])
Exemplo n.º 2
0
 def test_identity(self):
     '''Distance from list to itself should be 0'''
     a = [1, 2, 3]
     b = a
     self.assertEquals(compare_lists(a, b), 0)