Пример #1
0
 def test_dropping(self):
     result = transduce(transducer=dropping(3),
                        reducer=appending(),
                        iterable=[2, 4, 5, 8, 10])
     self.assertListEqual(result, [8, 10])
Пример #2
0
 def test_dropping_validation(self):
     with self.assertRaises(ValueError):
         transduce(transducer=dropping(-3),
                   reducer=appending(),
                   iterable=[2, 4, 5, 8, 10])
Пример #3
0
 def test_dropping_validation(self):
     with self.assertRaises(ValueError):
         transduce(transducer=dropping(-3),
                   reducer=appending(),
                   iterable=[2, 4, 5, 8, 10])
Пример #4
0
 def test_dropping(self):
     result = transduce(transducer=dropping(3),
                        reducer=appending(),
                        iterable=[2, 4, 5, 8, 10])
     self.assertListEqual(result, [8, 10])