예제 #1
0
 def test_Planter_knownGoodStrings(self):
     p = tokentree.Planter(self.fTestA)
     for s in ["ababbb", "abbbab"]:
         self.assertTrue(s in p.tokenValidator, s)
예제 #2
0
 def test_Planter_knownBadStrings(self):
     p = tokentree.Planter(self.fTestA)
     for s in ["bababa", "aaabbb", "aaaabbb"]:
         self.assertFalse(s in p.tokenValidator, s)
예제 #3
0
 def test_Planter_fTestA_root3_knownBad(self):
     p = tokentree.Planter(self.fTestA, rootRule="3")
     self.assertTrue("ab" in p.tokenValidator, "ab")
     self.assertTrue("ba" in p.tokenValidator, "ba")
예제 #4
0
 def test_Planter_fTestD(self):
     p = tokentree.Planter(self.fTestD)
     self.assertEqual(3, len(p.tokensValid))
예제 #5
0
 def test_Planter_fTestA_root3_knownGood(self):
     p = tokentree.Planter(self.fTestA, rootRule="3")
     self.assertFalse("aa" in p.tokenValidator, "aa")
     self.assertFalse("bb" in p.tokenValidator, "bb")