diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-20 18:22:17 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-02-20 18:37:59 -0300 |
commit | babe9db5515e38635e04c2fd018fcfe5b24d40e8 (patch) | |
tree | dd0acd5acf51e3346b8d10d0f8c4cd30a770ceec /tests | |
parent | c440eccaef049b03a21022af6286e819259777b2 (diff) |
Added a new case to translation unit tests.
The new test calls QCoreApplication.translate passing None to an
argument that in C++ expects a 'const char*' and accepts a null pointer.
Reviewed by Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/qtcore/translation_test.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/qtcore/translation_test.py b/tests/qtcore/translation_test.py index e1007cc5f..870c8c50f 100644 --- a/tests/qtcore/translation_test.py +++ b/tests/qtcore/translation_test.py @@ -5,7 +5,7 @@ import os import unittest -from PySide.QtCore import QObject, QTranslator, QCoreApplication +from PySide.QtCore import QObject, QTranslator, QCoreApplication, QString from helper import UsesQCoreApplication @@ -51,7 +51,11 @@ class TranslationTest(UsesQCoreApplication): obj.setObjectName(obj.trUtf8('Hello World!')) self.assertEqual(obj.objectName(), u'привет мир!') - + def testTranslateWithNoneDisambiguation(self): + value = 'String here' + obj = QCoreApplication.translate('context', value, None, QCoreApplication.UnicodeUTF8) + self.assert_(isinstance(obj, QString)) + self.assertEqual(obj, value) if __name__ == '__main__': unittest.main() |