Exemple #1
0
 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')
     ])
Exemple #2
0
 def testCanBuildTemplateWithCode(self):
     textTemplate = xsc._InlineTemplate('${2 + 3}')
     self.assertTrue(textTemplate)
     self.assertEqual(textTemplate._items, [('code', u'2 + 3')])
Exemple #3
0
 def testCanBuildTemplateWithDollar(self):
     textTemplate = xsc._InlineTemplate('$$')
     self.assertTrue(textTemplate)
     self.assertEqual(textTemplate._items, [('text', u'$')])
Exemple #4
0
 def testCanBuildTemplateWithTextAtEnd(self):
     textTemplate = xsc._InlineTemplate('hello')
     self.assertTrue(textTemplate)
     self.assertEqual(textTemplate._items, [('text', u'hello')])