aboutsummaryrefslogtreecommitdiffstats
path: root/test/ext/test_linguaplugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/ext/test_linguaplugin.py')
-rw-r--r--test/ext/test_linguaplugin.py61
1 files changed, 34 insertions, 27 deletions
diff --git a/test/ext/test_linguaplugin.py b/test/ext/test_linguaplugin.py
index 9c46271..a563969 100644
--- a/test/ext/test_linguaplugin.py
+++ b/test/ext/test_linguaplugin.py
@@ -1,5 +1,8 @@
import os
-from .. import TemplateTest, template_base, skip_if
+
+from .. import skip_if
+from .. import template_base
+from .. import TemplateTest
try:
import lingua
@@ -18,40 +21,44 @@ class MockOptions:
def skip():
return skip_if(
- lambda: not lingua, 'lingua not installed: skipping linguaplugin test')
+ lambda: not lingua, "lingua not installed: skipping linguaplugin test"
+ )
class ExtractMakoTestCase(TemplateTest):
@skip()
def test_extract(self):
register_extractors()
- plugin = LinguaMakoExtractor({'comment-tags': 'TRANSLATOR'})
+ plugin = LinguaMakoExtractor({"comment-tags": "TRANSLATOR"})
messages = list(
- plugin(os.path.join(template_base, 'gettext.mako'), MockOptions()))
+ plugin(os.path.join(template_base, "gettext.mako"), MockOptions())
+ )
msgids = [(m.msgid, m.msgid_plural) for m in messages]
self.assertEqual(
msgids,
[
- ('Page arg 1', None),
- ('Page arg 2', None),
- ('Begin', None),
- ('Hi there!', None),
- ('Hello', None),
- ('Welcome', None),
- ('Yo', None),
- ('The', None),
- ('bunny', 'bunnies'),
- ('Goodbye', None),
- ('Babel', None),
- ('hella', 'hellas'),
- ('The', None),
- ('bunny', 'bunnies'),
- ('Goodbye, really!', None),
- ('P.S. byebye', None),
- ('Top', None),
- (u'foo', None),
- ('hoho', None),
- (u'bar', None),
- ('Inside a p tag', None),
- ('Later in a p tag', None),
- ('No action at a distance.', None)])
+ ("Page arg 1", None),
+ ("Page arg 2", None),
+ ("Begin", None),
+ ("Hi there!", None),
+ ("Hello", None),
+ ("Welcome", None),
+ ("Yo", None),
+ ("The", None),
+ ("bunny", "bunnies"),
+ ("Goodbye", None),
+ ("Babel", None),
+ ("hella", "hellas"),
+ ("The", None),
+ ("bunny", "bunnies"),
+ ("Goodbye, really!", None),
+ ("P.S. byebye", None),
+ ("Top", None),
+ (u"foo", None),
+ ("hoho", None),
+ (u"bar", None),
+ ("Inside a p tag", None),
+ ("Later in a p tag", None),
+ ("No action at a distance.", None),
+ ],
+ )