summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-09-01 14:09:54 -0300
committerLauro Neto <lauro.neto@openbossa.org>2011-09-01 14:16:16 -0300
commit5c39c42bfbc0dcb19f372646c972e4595e301d4f (patch)
treeca440b458e5efc6f994d2a19c5a6cc2f0df619a8
parent1261f293486caa7df9e6d18c14bb0b141f12e7f5 (diff)
downloadpyside-5c39c42bfbc0dcb19f372646c972e4595e301d4f.tar.gz
pyside-5c39c42bfbc0dcb19f372646c972e4595e301d4f.tar.xz
pyside-5c39c42bfbc0dcb19f372646c972e4595e301d4f.zip
Add extra test on QByteArray explicit conversion
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r--tests/QtCore/qbytearray_test.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/QtCore/qbytearray_test.py b/tests/QtCore/qbytearray_test.py
index 38ed2ab..b12f7f9 100644
--- a/tests/QtCore/qbytearray_test.py
+++ b/tests/QtCore/qbytearray_test.py
@@ -154,6 +154,13 @@ class QByteArrayBug720(unittest.TestCase):
self.assertEqual(str(ba), "32\"1\x00123")
self.assertEqual(repr(ba), "PySide.QtCore.QByteArray('32\"1\\x00123')")
+class QByteArrayImplicitConvert(unittest.TestCase):
+ def testString(self):
+ # No implicit conversions from QByteArray to python string
+ ba = QByteArray("object name")
+ obj = QObject()
+ self.assertRaises(TypeError, obj.setObjectName, ba)
+
if __name__ == '__main__':
unittest.main()