Esempio n. 1
0
 def test_batching_validation(self):
     with self.assertRaises(ValueError):
         transduce(transducer=batching(0),
                   reducer=appending(),
                   iterable=[42, 12, 45, 9, 18, 3, 34, 13])
Esempio n. 2
0
 def test_batching_validation(self):
     with self.assertRaises(ValueError):
         transduce(transducer=batching(0),
                   reducer=appending(),
                   iterable=[42, 12, 45, 9, 18, 3, 34, 13])
Esempio n. 3
0
 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]])
Esempio n. 4
0
 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]])