Does not makes sense concat a unicode string with a QByteArray.

Because the user does not know nothing about the internal representation of the unicode string.

Reviewed by Lauro Moura <lauro.moura@openbossa.org>
This commit is contained in:
Hugo Lima 2010-01-18 14:59:09 -02:00
commit 53500b6542

View file

@ -35,17 +35,19 @@ class QByteArrayConcatenationOperatorTest(unittest.TestCase):
self.assertTrue(concat_python_string_add_qbytearray_worked) self.assertTrue(concat_python_string_add_qbytearray_worked)
self.assertEqual(result.__class__.__name__, 'QByteArray') self.assertEqual(result.__class__.__name__, 'QByteArray')
def testConcatPythonUnicodeAndQByteArray(self): # NOTICE: Does not makes sense concat a unicode string with a QByteArray, because the
#Test concatenation of a Python unicode object with a QByteArray, in this order # user does not know nothing about the internal representation of the unicode string.
concat_python_unicode_add_qbytearray_worked = True #def testConcatPythonUnicodeAndQByteArray(self):
qba = QByteArray('foo') ##Test concatenation of a Python unicode object with a QByteArray, in this order
result = None #concat_python_unicode_add_qbytearray_worked = True
try: #qba = QByteArray('foo')
result = u'ümlaut' + qba #result = None
except: #try:
concat_python_unicode_add_qbytearray_worked = False #result = u'ümlaut' + qba
self.assertTrue(concat_python_unicode_add_qbytearray_worked) #except:
self.assertEqual(result.__class__.__name__, 'unicode') #concat_python_unicode_add_qbytearray_worked = False
#self.assertTrue(concat_python_unicode_add_qbytearray_worked)
#self.assertEqual(result.__class__.__name__, 'unicode')
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()