(self)
| 403 | self.assertEqual(val, 'PyCon in Cleveland') |
| 404 | |
| 405 | def test_braced_override_safe(self): |
| 406 | class MyTemplate(Template): |
| 407 | pattern = r""" |
| 408 | \$(?: |
| 409 | (?P<escaped>$) | |
| 410 | (?P<named>[_a-z][_a-z0-9]*) | |
| 411 | @@(?P<braced>[_a-z][_a-z0-9]*)@@ | |
| 412 | (?P<invalid>) | |
| 413 | ) |
| 414 | """ |
| 415 | |
| 416 | tmpl = 'PyCon in $@@location@@' |
| 417 | t = MyTemplate(tmpl) |
| 418 | self.assertEqual(t.safe_substitute(), tmpl) |
| 419 | val = t.safe_substitute({'location': 'Cleveland'}) |
| 420 | self.assertEqual(val, 'PyCon in Cleveland') |
| 421 | |
| 422 | def test_invalid_with_no_lines(self): |
| 423 | # The error formatting for invalid templates |
nothing calls this directly
no test coverage detected