def test_batching_validation(self): with self.assertRaises(ValueError): transduce(transducer=batching(0), reducer=appending(), iterable=[42, 12, 45, 9, 18, 3, 34, 13])
def test_batching_inexact_2(self): result = transduce(transducer=batching(3), reducer=appending(), iterable=[42, 12, 45, 9, 18, 3, 34, 13]) self.assertListEqual(result, [[42, 12, 45], [9, 18, 3], [34, 13]])