aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtCore
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-09-01 14:09:54 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:50 -0300
commit7ee30db078e15913c0a50016deb33113f06aa5dd (patch)
tree9fb0ec0cf102667ef1bf086f50e8152e915e8ccb /tests/QtCore
parent9afe76796d365978ee4be04e195cc5ec43758868 (diff)
Add extra test on QByteArray explicit conversion
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/QtCore')
-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 38ed2ab1c..b12f7f9d5 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()