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