Ejemplo n.º 1
0
 def test_or(self):
     self._test_opt("a or b", dict(a=False), "b")
     self._test_opt("a or b", dict(a=True), "True")
     self._test_opt("a or b", dict(a=False, b=False), "False")
     self._test_opt("a or b()", dict(a=False, b=pure_function(lambda: True)), "True")
     self._test_opt("a or b or c or d", dict(a=False, c=False), "b or d")
Ejemplo n.º 2
0
 def test_and(self):
     self._test_opt("a and b", dict(a=False), "False")
     self._test_opt("a and b", dict(a=True), "b")
     self._test_opt("a and b()", dict(a=True, b=pure_function(lambda: True)), "True")
     self._test_opt("a and b and c and d", dict(a=True, c=True), "b and d")