def test_batch(self): """ Tests :func:`colour.utilities.common.batch` definition. """ self.assertListEqual( list(batch(tuple(range(10)))), [(0, 1, 2), (3, 4, 5), (6, 7, 8), (9,)]) self.assertListEqual( list(batch(tuple(range(10)), 5)), [(0, 1, 2, 3, 4), (5, 6, 7, 8, 9)]) self.assertListEqual( list(batch(tuple(range(10)), 1)), [(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,)])
def test_batch(self): """ Tests :func:`colour.utilities.common.batch` definition. """ self.assertListEqual( list(batch(tuple(range(10)))), [(0, 1, 2), (3, 4, 5), (6, 7, 8), (9,)]) self.assertListEqual( list(batch(tuple(range(10)), 5)), [(0, 1, 2, 3, 4), (5, 6, 7, 8, 9)]) self.assertListEqual( list(batch(tuple(range(10)), 1)), [(0,), (1,), (2,), (3,), (4,), (5,), (6,), (7,), (8,), (9,)])