Ejemplo n.º 1
0
 def test_logical_ops(self):
     """ Test for the && and || operators precedence"""
     # Would evaluate to false if precedence was wrong
     self.assertTrue(
         Expression(
             "PASS == PASS || PASS != NOTPASS && PASS == NOTPASS").evaluate(
                 self.c))
Ejemplo n.º 2
0
 def test_defined(self):
     """ Test for the defined() value"""
     self.assertTrue(Expression("defined(FAIL)").evaluate(self.c))
     self.assertTrue(Expression("!defined(PASS)").evaluate(self.c))
Ejemplo n.º 3
0
 def test_logical_or(self):
     """ Test for the || operator"""
     self.assertTrue(
         Expression("PASS == NOTPASS || PASS != NOTPASS").evaluate(self.c))
Ejemplo n.º 4
0
 def test_notequals(self):
     """ Test for the != operator"""
     self.assert_(Expression("FAIL != 1").evaluate(self.c))
Ejemplo n.º 5
0
 def test_logical_and(self):
     """ Test for the && operator"""
     self.assertTrue(
         Expression("PASS == PASS && PASS != NOTPASS").evaluate(self.c))
Ejemplo n.º 6
0
 def test_equals(self):
     """ Test for the == operator"""
     self.assert_(Expression("FAIL == PASS").evaluate(self.c))
Ejemplo n.º 7
0
 def test_not(self):
     """Test for the ! operator"""
     self.assert_(Expression("!0").evaluate(self.c))
     self.assert_(not Expression("!1").evaluate(self.c))
Ejemplo n.º 8
0
 def test_variable(self):
     """Test for variable value in an Expression"""
     self.assertEqual(Expression("FAIL").evaluate(self.c), "PASS")
Ejemplo n.º 9
0
 def test_string_literal(self):
     """Test for a string literal in an Expression"""
     self.assertEqual(Expression("PASS").evaluate(self.c), "PASS")
Ejemplo n.º 10
0
 def test_variable(self):
     """Test for variable value in an Expression"""
     self.assertEqual(Expression('FAIL').evaluate(self.c), 'PASS')