def test_last_with_predicate(self): result = transduce(transducer=last(lambda x: x < 7), reducer=expecting_single(), iterable=[2, 4, 6, 8, 10]) self.assertEqual(result, 6)
def test_last(self): result = transduce(transducer=last(), reducer=expecting_single(), iterable=[2, 4, 6, 8, 10]) self.assertEqual(result, 10)