Mercurial > babel > mirror
annotate babel/catalog/tests/pofile.py @ 17:55e22bc56f0c trunk
Recognize python-format messages also for unnamed parameters.
author | cmlenz |
---|---|
date | Thu, 31 May 2007 17:07:49 +0000 |
parents | e6ba3e878b10 |
children | b09e90803d1b |
rev | line source |
---|---|
1 | 1 # -*- coding: utf-8 -*- |
2 # | |
12
e6ba3e878b10
* Removed pkg_resources/setuptools requirement from various places.
cmlenz
parents:
1
diff
changeset
|
3 # Copyright (C) 2007 Edgewall Software |
1 | 4 # All rights reserved. |
5 # | |
6 # This software is licensed as described in the file COPYING, which | |
7 # you should have received as part of this distribution. The terms | |
8 # are also available at http://babel.edgewall.org/wiki/License. | |
9 # | |
10 # This software consists of voluntary contributions made by many | |
11 # individuals. For the exact contribution history, see the revision | |
12 # history and logs, available at http://babel.edgewall.org/log/. | |
13 | |
14 import doctest | |
15 import unittest | |
16 | |
17 from babel.catalog import pofile | |
18 | |
17
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
19 |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
20 class PythonFormatFlagUnitTest(unittest.TestCase): |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
21 |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
22 def test_without_name(self): |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
23 assert pofile.PYTHON_FORMAT('foo %d bar') |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
24 assert pofile.PYTHON_FORMAT('foo %s bar') |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
25 assert pofile.PYTHON_FORMAT('foo %r bar') |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
26 |
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
27 |
1 | 28 def suite(): |
29 suite = unittest.TestSuite() | |
30 suite.addTest(doctest.DocTestSuite(pofile)) | |
17
55e22bc56f0c
Recognize python-format messages also for unnamed parameters.
cmlenz
parents:
12
diff
changeset
|
31 suite.addTest(unittest.makeSuite(PythonFormatFlagUnitTest)) |
1 | 32 return suite |
33 | |
34 if __name__ == '__main__': | |
35 unittest.main(defaultTest='suite') |