Ejemplo n.º 1
0
 def test_padwith(self):
     eq_(batch([1, 2, 3, 4, 5], '2,FOO'), [[1, 2], [3, 4], [5, 'FOO']])
Ejemplo n.º 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])
Ejemplo n.º 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]])
Ejemplo n.º 4
0
 def test_padwith(self):
     assert batch([1, 2, 3, 4, 5], '2,FOO') == [[1, 2], [3, 4], [5, 'FOO']]
Ejemplo n.º 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]
Ejemplo n.º 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]]