7
from mako.ext.babelplugin import extract
9
class ExtractMakoTestCase(unittest.TestCase):
10
def test_extract(self):
11
mako_tmpl = open(os.path.join('test_htdocs', 'gettext.mako'))
12
messages = list(extract(mako_tmpl, {'_': None, 'gettext': None,
16
[(1, '_', u'Page arg 1', []),
17
(1, '_', u'Page arg 2', []),
18
(10, 'gettext', u'Begin', []),
19
(14, '_', u'Hi there!', [u'Hi there!']),
20
(19, '_', u'Hello', []),
21
(22, '_', u'Welcome', []),
23
(36, '_', u'The', [u'Ensure so and', u'so, thanks']),
24
(36, 'ungettext', (u'bunny', u'bunnies', None), []),
25
(41, '_', u'Goodbye', [u'Good bye']),
26
(44, '_', u'Babel', []),
27
(45, 'ungettext', (u'hella', u'hellas', None), []),
28
(62, '_', u'Goodbye, really!', [u'HTML comment']),
29
(65, '_', u'P.S. byebye', []),
30
(71, '_', u'Top', [])]
31
self.assertEqual(expected, messages)
35
warnings.warn('babel not installed: skipping babelplugin test',
38
if __name__ == '__main__':