Ejemplo n.º 1
0
 def test_predicate(self):
     self.assertIsInstance(1, predicate(lambda x: x > 0))
     self.assertNotIsInstance(0, predicate(lambda x: x > 0))
     self.assertNotIsInstance(-1, predicate(lambda x: x > 0))
Ejemplo n.º 2
0
 def test(a: predicate(lambda x: x > 0)):
     return a
Ejemplo n.º 3
0
 def test(a: predicate(lambda x: x > 0)):
     return a
Ejemplo n.º 4
0
 def test_predicate(self):
     self.assertIsInstance(1, predicate(lambda x: x > 0))
     self.assertNotIsInstance(0, predicate(lambda x: x > 0))
     self.assertNotIsInstance(-1, predicate(lambda x: x > 0))