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:
parent
2f726de360
commit
53500b6542
1 changed files with 13 additions and 11 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue