(self)
| 420 | self.assertEqual(val, 'PyCon in Cleveland') |
| 421 | |
| 422 | def test_invalid_with_no_lines(self): |
| 423 | # The error formatting for invalid templates |
| 424 | # has a special case for no data that the default |
| 425 | # pattern can't trigger (always has at least '$') |
| 426 | # So we craft a pattern that is always invalid |
| 427 | # with no leading data. |
| 428 | class MyTemplate(Template): |
| 429 | pattern = r""" |
| 430 | (?P<invalid>) | |
| 431 | unreachable( |
| 432 | (?P<named>) | |
| 433 | (?P<braced>) | |
| 434 | (?P<escaped>) |
| 435 | ) |
| 436 | """ |
| 437 | s = MyTemplate('') |
| 438 | with self.assertRaises(ValueError) as err: |
| 439 | s.substitute({}) |
| 440 | self.assertIn('line 1, col 1', str(err.exception)) |
| 441 | |
| 442 | def test_unicode_values(self): |
| 443 | s = Template('$who likes $what') |
nothing calls this directly
no test coverage detected