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