diff options
author | Wichert Akkerman <wichert@wiggy.net> | 2014-08-25 22:55:30 +0200 |
---|---|---|
committer | Wichert Akkerman <wichert@wiggy.net> | 2014-08-25 22:55:30 +0200 |
commit | a394b7bae9c5a2a9618973df85dccacbbb7b933d (patch) | |
tree | 8e2845deb39ee83aca978e0a9369b81b655c40c8 /test | |
parent | 14a45cb3cffbe2e967c865f9abe4242f08a9c94a (diff) | |
download | external_python_mako-a394b7bae9c5a2a9618973df85dccacbbb7b933d.tar.gz external_python_mako-a394b7bae9c5a2a9618973df85dccacbbb7b933d.tar.bz2 external_python_mako-a394b7bae9c5a2a9618973df85dccacbbb7b933d.zip |
Add lingua plugin
Diffstat (limited to 'test')
-rw-r--r-- | test/ext/test_linguaplugin.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ext/test_linguaplugin.py b/test/ext/test_linguaplugin.py new file mode 100644 index 0000000..841f206 --- /dev/null +++ b/test/ext/test_linguaplugin.py @@ -0,0 +1,19 @@ +import io +import mock +import unittest +from mako.ext.linguaplugin import LinguaMakoExtractor + + +class MockOptions: + keywords = [] + domain = None + + +class Test_LinguaMakoExtractor(unittest.TestCase): + def test_parse_python_expression(self): + plugin = LinguaMakoExtractor() + plugin.options = MockOptions() + plugin.filename = 'dummy.mako' + input = io.BytesIO(b'<p>${_("Message")}</p>') + messages = list(plugin.process_file(input)) + self.assertEqual(len(messages), 1) |