summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Birtwell <michael.birtwell@starleaf.com>2016-10-12 17:15:43 +0100
committerMichael Birtwell <michael.birtwell@starleaf.com>2016-11-21 14:32:49 +0000
commit2ba92312514fcac4902c624b571e8c8a7081658b (patch)
tree5d0d8eacf24bdca65ddb3122fddbd4b57629127f /tests
parent467bf955711e9224bb9f51a9620282d98e61f6c6 (diff)
downloadbabel-2ba92312514fcac4902c624b571e8c8a7081658b.tar.gz
pofile reader: Fix multi line msgctxt
Diffstat (limited to 'tests')
-rw-r--r--tests/messages/test_pofile.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/messages/test_pofile.py b/tests/messages/test_pofile.py
index cdb90f5..64bf714 100644
--- a/tests/messages/test_pofile.py
+++ b/tests/messages/test_pofile.py
@@ -287,6 +287,20 @@ msgstr "Bahr"
self.assertEqual(message.context, "other")
self.assertEqual(message.string, "Voh")
+ def test_multiline_context(self):
+ buf = StringIO('''
+msgctxt "a really long "
+"message context "
+"why?"
+msgid "mid"
+msgstr "mst"
+ ''')
+ catalog = pofile.read_po(buf)
+ self.assertEqual(1, len(catalog))
+ message = catalog.get('mid', context="a really long message context why?")
+ assert message is not None
+ self.assertEqual("a really long message context why?", message.context)
+
def test_with_context_two(self):
buf = BytesIO(b'''msgctxt "Menu"
msgid "foo"