def testCanBuildMixedTemplate(self): textTemplate = xsc._InlineTemplate('hugo has ${200 + 300}$$ and he likes it') self.assertTrue(textTemplate) self.assertEqual(textTemplate._items, [ ('text', u'hugo has '), ('code', u'200 + 300'), ('text', u'$'), ('text', u' and he likes it') ])
def testCanBuildTemplateWithCode(self): textTemplate = xsc._InlineTemplate('${2 + 3}') self.assertTrue(textTemplate) self.assertEqual(textTemplate._items, [('code', u'2 + 3')])
def testCanBuildTemplateWithDollar(self): textTemplate = xsc._InlineTemplate('$$') self.assertTrue(textTemplate) self.assertEqual(textTemplate._items, [('text', u'$')])
def testCanBuildTemplateWithTextAtEnd(self): textTemplate = xsc._InlineTemplate('hello') self.assertTrue(textTemplate) self.assertEqual(textTemplate._items, [('text', u'hello')])