Example #1
0
 def test__fullmatch_09(self):
     gd = dict()
     m = functions_.fullmatch(r'(?P<w1>\w+) (?P<w2>\w+) (?P<w3>\w+)', ' this is text ', groupdict = gd)
     self.assertFalse(m)
     self.assertEqual(gd, dict())
Example #2
0
 def test__fullmatch_08(self):
     gd = dict()
     m = functions_.fullmatch(r'(?P<w1>\w+) (?P<w2>\w+) (?P<w3>\w+)', 'this is text', groupdict = gd)
     self.assertTrue(m)
     self.assertEqual(gd, {'w1' : 'this', 'w2' : 'is', 'w3' : 'text'})
Example #3
0
 def test__fullmatch_07(self):
     m = functions_.fullmatch(r'this is text', '  this is text  ', strip = True)
     self.assertTrue(m)
     self.assertEqual(m.span(), (0,12))
Example #4
0
 def test__fullmatch_06(self):
     m = functions_.fullmatch(r'this is text', '  this is text  ')
     self.assertIsNone(m)
Example #5
0
 def test__fullmatch_04(self):
     m = functions_.fullmatch(re.compile(r'this is'), 'this is text')
     self.assertIsNone(m)
Example #6
0
 def test__fullmatch_02(self):
     m = functions_.fullmatch(re.compile(r'this is text'), 'this is text')
     self.assertTrue(m)
     self.assertEqual(m.span(), (0,12))