MCPcopy
hub / github.com/django/django / test_group_named

Method test_group_named

tests/utils_tests/test_regex_helper.py:33–42  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

31 self.assertEqual(result, expected)
32
33 def test_group_named(self):
34 pattern = r"(?P<first_group_name>.*)-(?P<second_group_name>.*)"
35 expected = [
36 (
37 "%(first_group_name)s-%(second_group_name)s",
38 ["first_group_name", "second_group_name"],
39 )
40 ]
41 result = regex_helper.normalize(pattern)
42 self.assertEqual(result, expected)
43
44 def test_group_backreference(self):
45 pattern = r"(?P<first_group_name>.*)-(?P=first_group_name)"

Callers

nothing calls this directly

Calls 1

normalizeMethod · 0.45

Tested by

no test coverage detected