def test_one_chunk(self): data = [1] self.assertEqual([[1]], list(chunks(data, 1)))
def test_chunk_group_2(self): data = [1, 2, 3, 4] self.assertEqual([[1, 2], [3, 4]], list(chunks(data, 2)))
def test_empty(self): data = [] self.assertEqual([], list(chunks(data, 1)))
def test_chuck_group_1(self): data = [1, 2] self.assertEqual([[1], [2]], list(chunks(data, 1)))