MCPcopy Create free account
hub / github.com/davidblewett/rure-python / test_group

Method test_group

rure/tests/test_matchobject.py:16–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

14 self.assertFalse(pattern.search(u"dog", 1))
15
16 def test_group(self):
17 m = rure.match(u"(\\w+) (\\w+)", u"Isaac Newton, physicist")
18 self.assertEqual(m.group(0), u'Isaac Newton')
19 self.assertEqual(m.group(1), u'Isaac')
20 self.assertEqual(m.group(2), u'Newton')
21 self.assertEqual(m.group(1, 2), ('Isaac', 'Newton'))
22
23 def test_complicated_group(self):
24 m = rure.match(u"(?P<first_name>\\w+) (?P<last_name>\\w+)",

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
groupMethod · 0.45

Tested by

no test coverage detected