diff options
author | Renato Filho <renato.filho@openbossa.org> | 2011-09-08 14:32:32 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:54:51 -0300 |
commit | cf61c805887823f290e52e55fe06d15844ac82aa (patch) | |
tree | 692712f3705d8be73fafc2b9940178498433cc94 /tests | |
parent | a92a006fd9d6c3256071e75c3bc13ec3a7a83586 (diff) |
Created unit test for bug #997.
Reviewer: Hugo Parente <hugo.lima@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/QtDeclarative/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtDeclarative/bug_997.py | 24 | ||||
-rw-r--r-- | tests/QtDeclarative/bug_997.qml | 6 |
3 files changed, 31 insertions, 0 deletions
diff --git a/tests/QtDeclarative/CMakeLists.txt b/tests/QtDeclarative/CMakeLists.txt index 279987ef3..94e994ad0 100644 --- a/tests/QtDeclarative/CMakeLists.txt +++ b/tests/QtDeclarative/CMakeLists.txt @@ -8,6 +8,7 @@ PYSIDE_TEST(bug_847.py) PYSIDE_TEST(bug_915.py) PYSIDE_TEST(bug_926.py) PYSIDE_TEST(bug_951.py) +PYSIDE_TEST(bug_997.py) PYSIDE_TEST(qdeclarativenetwork_test.py) PYSIDE_TEST(qdeclarativeview_test.py) PYSIDE_TEST(connect_python_qml.py) diff --git a/tests/QtDeclarative/bug_997.py b/tests/QtDeclarative/bug_997.py new file mode 100644 index 000000000..6c3587af6 --- /dev/null +++ b/tests/QtDeclarative/bug_997.py @@ -0,0 +1,24 @@ +from PySide import QtCore, QtDeclarative + +import unittest +from helper import adjust_filename, UsesQApplication + + +class TestBug(UsesQApplication): + def testQMLFunctionCall(self): + ownerData = QtDeclarative.QDeclarativePropertyMap() + ownerData.insert('name', 'John Smith') + ownerData.insert('phone', '555-5555') + ownerData.insert('newValue', '') + + view = QtDeclarative.QDeclarativeView() + ctxt = view.rootContext() + ctxt.setContextProperty('owner', ownerData) + view.setSource(QtCore.QUrl.fromLocalFile(adjust_filename('bug_997.qml', __file__))) + view.show() + QtCore.QTimer.singleShot(1000, self.app.quit) + self.app.exec_() + self.assertEqual(ownerData.value('newName'), ownerData.value('name')) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/QtDeclarative/bug_997.qml b/tests/QtDeclarative/bug_997.qml new file mode 100644 index 000000000..43449bf4f --- /dev/null +++ b/tests/QtDeclarative/bug_997.qml @@ -0,0 +1,6 @@ +import Qt 4.7 + +Text { + text: owner.name + " " + owner.phone + Component.onCompleted: { owner.newName = owner.name } +} |