(self)
| 445 | self.assertEqual(s.substitute(d), 't\xffm likes f\xfe\x0ced') |
| 446 | |
| 447 | def test_keyword_arguments(self): |
| 448 | eq = self.assertEqual |
| 449 | s = Template('$who likes $what') |
| 450 | eq(s.substitute(who='tim', what='ham'), 'tim likes ham') |
| 451 | eq(s.substitute(dict(who='tim'), what='ham'), 'tim likes ham') |
| 452 | eq(s.substitute(dict(who='fred', what='kung pao'), |
| 453 | who='tim', what='ham'), |
| 454 | 'tim likes ham') |
| 455 | s = Template('the mapping is $mapping') |
| 456 | eq(s.substitute(dict(foo='none'), mapping='bozo'), |
| 457 | 'the mapping is bozo') |
| 458 | eq(s.substitute(dict(mapping='one'), mapping='two'), |
| 459 | 'the mapping is two') |
| 460 | |
| 461 | s = Template('the self is $self') |
| 462 | eq(s.substitute(self='bozo'), 'the self is bozo') |
| 463 | |
| 464 | def test_keyword_arguments_safe(self): |
| 465 | eq = self.assertEqual |
nothing calls this directly
no test coverage detected