diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-10-03 18:49:42 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:08 -0300 |
commit | 1e29ab65924166688e352eaaa099ad571a980c4f (patch) | |
tree | 2a7ae3cb38b33a3211c9cec0da70016dd5d44c1d /tests/QtCore/translation_test.py | |
parent | a2cb6fe0254a122f0ad9d2ee991d9a249903ee12 (diff) |
Initia QtCore port to python3.
Diffstat (limited to 'tests/QtCore/translation_test.py')
-rw-r--r-- | tests/QtCore/translation_test.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/QtCore/translation_test.py b/tests/QtCore/translation_test.py index d357b90d2..99d4bf4e1 100644 --- a/tests/QtCore/translation_test.py +++ b/tests/QtCore/translation_test.py @@ -4,9 +4,9 @@ '''Unit tests to test QTranslator and translation in general.''' import os -import glob import unittest -from PySide.QtCore import * +import py3kcompat as py3k +from PySide.QtCore import QObject, QTranslator, QCoreApplication from helper import UsesQCoreApplication @@ -25,7 +25,7 @@ class TranslationTest(UsesQCoreApplication): obj = QObject() obj.setObjectName(obj.tr('Hello World!')) - self.assertEqual(obj.objectName(), u'Orbis, te saluto!') + self.assertEqual(obj.objectName(), py3k.unicode('Orbis, te saluto!')) def testRussian(self): #Set string value to Russian @@ -35,7 +35,7 @@ class TranslationTest(UsesQCoreApplication): obj = QObject() obj.setObjectName(obj.tr('Hello World!')) - self.assertEqual(obj.objectName(), u'привет мир!') + self.assertEqual(obj.objectName(), py3k.unicode('привет мир!')) def testUtf8(self): translator = QTranslator() @@ -44,12 +44,12 @@ class TranslationTest(UsesQCoreApplication): obj = QObject() obj.setObjectName(obj.trUtf8('Hello World!')) - self.assertEqual(obj.objectName(), u'привет мир!') + self.assertEqual(obj.objectName(), py3k.unicode('привет мир!')) def testTranslateWithNoneDisambiguation(self): value = 'String here' obj = QCoreApplication.translate('context', value, None, QCoreApplication.UnicodeUTF8) - self.assert_(isinstance(obj, unicode)) + self.assertTrue(isinstance(obj, py3k.unicode)) self.assertEqual(obj, value) if __name__ == '__main__': |