def test_predicate(self): items_p = arrange(self.items, 8, predicate=lambda l: l.append(99)) nplots = len(items_p) ref = [99 for j in range(nplots)] for i in range(nplots): self.assertListEqual([l[-1] for l in items_p], ref)
def test_reverse(self): rearranged = arrange(self.items, 8) for l in rearranged: l.reverse() items_r = arrange(self.items, 8, reverse=True) self.assertListEqual(rearranged, items_r)
def test_arrange(self): rearranged = arrange(self.items, 8) self.assertEqual(len(rearranged), 2) self.assertEqual(len(rearranged[0]), len(rearranged[1]))