示例#1
0
 def testRegexMatch(self):
     f = utils.FieldSet("a", "b([0-9]+)", "c")
     self.failUnless(f.Matches("b1"))
     self.failUnless(f.Matches("b99"))
     self.failIf(f.Matches("b/1"))
     self.failIf(f.NonMatching(["b12", "c"]))
     self.failUnless(f.NonMatching(["a", "1"]))
示例#2
0
 def testRegexMatch(self):
     f = utils.FieldSet("a", "b([0-9]+)", "c")
     self.assertTrue(f.Matches("b1"))
     self.assertTrue(f.Matches("b99"))
     self.assertFalse(f.Matches("b/1"))
     self.assertFalse(f.NonMatching(["b12", "c"]))
     self.assertTrue(f.NonMatching(["a", "1"]))
示例#3
0
 def testSimpleMatch(self):
     f = utils.FieldSet("a", "b", "c", "def")
     self.failUnless(f.Matches("a"))
     self.failIf(f.Matches("d"), "Substring matched")
     self.failIf(f.Matches("defghi"), "Prefix string matched")
     self.failIf(f.NonMatching(["b", "c"]))
     self.failIf(f.NonMatching(["a", "b", "c", "def"]))
     self.failUnless(f.NonMatching(["a", "d"]))
示例#4
0
 def testSimpleMatch(self):
     f = utils.FieldSet("a", "b", "c", "def")
     self.assertTrue(f.Matches("a"))
     self.assertFalse(f.Matches("d"), "Substring matched")
     self.assertFalse(f.Matches("defghi"), "Prefix string matched")
     self.assertFalse(f.NonMatching(["b", "c"]))
     self.assertFalse(f.NonMatching(["a", "b", "c", "def"]))
     self.assertTrue(f.NonMatching(["a", "d"]))