Beispiel #1
0
 def testNonApplicableOptional(self):
     self.assertEqual(__optionalrule__(self.tree), False)
     self.assertEqual(len(self.tree), 7)
Beispiel #2
0
 def testDisjunctionRuleApplied(self):
     __optionalrule__(self.graph)
     self.assertEqual(__disjunctionrule__(self.graph), True)
     self.assert_(Disjunction(('a', 'c')) in self.graph.nodes)
Beispiel #3
0
 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)
Beispiel #4
0
 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)