def testNonApplicableOptional(self): self.assertEqual(__optionalrule__(self.tree), False) self.assertEqual(len(self.tree), 7)
def testDisjunctionRuleApplied(self): __optionalrule__(self.graph) self.assertEqual(__disjunctionrule__(self.graph), True) self.assert_(Disjunction(('a', 'c')) in self.graph.nodes)
def testConjunctionRuleApplied(self): __optionalrule__(self.graph) __disjunctionrule__(self.graph) self.assertEqual(__concatrule__(self.graph), True) self.assert_(Conjunction([Optional('b'), Disjunction(['c', 'a'])]) in self.graph.nodes)
def testOptionalRuleApplied(self): self.assertEqual(__optionalrule__(self.graph), True) self.assert_('b' not in self.graph.nodes) self.assert_(Optional('b') in self.graph.nodes)