~fenics-core/ufl/spatder2grad

« back to all changes in this revision

Viewing changes to test/test_conditionals.py

  • Committer: Martin Sandve Alnæs
  • Date: 2012-11-05 11:55:40 UTC
  • Revision ID: martinal@simula.no-20121105115540-xf52sb7ahtwfwxos
Add unit test for conditional.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
class ConditionalsTestCase(UflTestCase):
17
17
 
 
18
    def test_conditional_does_not_allow_bool_condition(self):
 
19
        # The reason for this test is that it protects from the case
 
20
        # conditional(a == b, t, f) in which a == b means comparing representations
 
21
        self.assertRaises(UFLException, lambda: conditional(True, 1, 0))
 
22
 
18
23
    def test_eq_produces_ufl_expr(self):
19
24
        expr1 = eq(f, f)
20
25
        expr2 = eq(f, g)