From 7ee30db078e15913c0a50016deb33113f06aa5dd Mon Sep 17 00:00:00 2001 From: Lauro Neto Date: Thu, 1 Sep 2011 14:09:54 -0300 Subject: Add extra test on QByteArray explicit conversion Reviewer: Luciano Wolf Reviewer: Marcelo Lira --- tests/QtCore/qbytearray_test.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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() -- cgit v1.2.3