Mercurial > babel > old > mirror
changeset 367:6bc1d13156c9
Fix typo and add a test for translator comments with leading spaces.
author | palgarvio |
---|---|
date | Thu, 26 Jun 2008 16:39:21 +0000 |
parents | 1cc8aba0363e |
children | dd63a41afbba |
files | babel/messages/tests/extract.py |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/babel/messages/tests/extract.py +++ b/babel/messages/tests/extract.py @@ -175,7 +175,7 @@ buf = StringIO(""" # This shouldn't be in the output # because it didn't start with a comment tag -# do NOTE: this will no be a translation comment +# do NOTE: this will not be a translation comment # NOTE: This one will be msg = _(u'Foo Bar') """) @@ -249,6 +249,17 @@ self.assertEqual(u'Hi there!', messages[0][2]) self.assertEqual([], messages[0][3]) + def test_comment_tag_with_leading_space(self): + buf = StringIO(""" + #: A translation comment + #: with leading spaces +msg = _(u'Foo Bar') +""") + messages = list(extract.extract_python(buf, ('_',), [':'], {})) + self.assertEqual(u'Foo Bar', messages[0][2]) + self.assertEqual([u': A translation comment', u': with leading spaces'], + messages[0][3]) + def test_different_signatures(self): buf = StringIO(""" foo = _('foo', 'bar')