def testAnyOfWithPredicate(self): lst = [1, 2, 3] self.assertTrue(any_of(lst, predicate=lambda i: i % 2 == 0)) self.assertFalse(any_of(lst, predicate=lambda i: i % 7 == 0))
def testAnyOf(self): lst = [1, 2, 3] self.assertTrue(any_of(lst, 2)) self.assertFalse(any_of(lst, 4))