Example #1
0
 def test_padwith(self):
     eq_(batch([1, 2, 3, 4, 5], '2,FOO'), [[1, 2], [3, 4], [5, 'FOO']])
Example #2
0
 def test_batch_edgecases(self):
     eq_(batch([1, 2, 3, 4, 5], '0'), [])
     eq_(batch([1, 2, 3, 4, 5], '1'), [1, 2, 3, 4, 5])
Example #3
0
 def test_batch(self):
     eq_(batch([], '2'), [])
     eq_(batch([1, 2, 3, 4, 5], '2'), [[1, 2], [3, 4], [5]])
     eq_(batch([1, 2, 3, 4, 5], '3'), [[1, 2, 3], [4, 5]])
Example #4
0
 def test_padwith(self):
     assert batch([1, 2, 3, 4, 5], '2,FOO') == [[1, 2], [3, 4], [5, 'FOO']]
Example #5
0
 def test_batch_edgecases(self):
     assert batch([1, 2, 3, 4, 5], '0') == []
     assert batch([1, 2, 3, 4, 5], '1') == [1, 2, 3, 4, 5]
Example #6
0
 def test_batch(self):
     assert batch([], '2') == []
     assert batch([1, 2, 3, 4, 5], '2') == [[1, 2], [3, 4], [5]]
     assert batch([1, 2, 3, 4, 5], '3') == [[1, 2, 3], [4, 5]]