def test_overwriting_template_args(self): t = Template('{{t|a|b|c}}') c = t.arguments[-1] self.assertEqual('|c', c.string) t.string = '{{t|0|a|b|c}}' self.assertEqual('', c.string) self.assertEqual('0', t.get_arg('1').value) self.assertEqual('c', t.get_arg('4').value)
def test_overwriting_template_args(): t = Template('{{t|a|b|c}}') c = t.arguments[-1] assert '|c' == c.string t.string = '{{t|0|a|b|c}}' assert '' == c.string assert '0' == t.get_arg('1').value assert 'c' == t.get_arg('4').value
def test_get_arg(self): t = Template('{{t|a|b=c}}') self.assertEqual('|a', t.get_arg('1').string) self.assertEqual(None, t.get_arg('c'))