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"]))
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"]))
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"]))
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"]))