Created unit test for bug #997.
Reviewer: Hugo Parente <hugo.lima@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
a92a006fd9
commit
cf61c80588
3 changed files with 31 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ PYSIDE_TEST(bug_847.py)
|
||||||
PYSIDE_TEST(bug_915.py)
|
PYSIDE_TEST(bug_915.py)
|
||||||
PYSIDE_TEST(bug_926.py)
|
PYSIDE_TEST(bug_926.py)
|
||||||
PYSIDE_TEST(bug_951.py)
|
PYSIDE_TEST(bug_951.py)
|
||||||
|
PYSIDE_TEST(bug_997.py)
|
||||||
PYSIDE_TEST(qdeclarativenetwork_test.py)
|
PYSIDE_TEST(qdeclarativenetwork_test.py)
|
||||||
PYSIDE_TEST(qdeclarativeview_test.py)
|
PYSIDE_TEST(qdeclarativeview_test.py)
|
||||||
PYSIDE_TEST(connect_python_qml.py)
|
PYSIDE_TEST(connect_python_qml.py)
|
||||||
|
|
|
||||||
24
tests/QtDeclarative/bug_997.py
Normal file
24
tests/QtDeclarative/bug_997.py
Normal file
|
|
@ -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()
|
||||||
6
tests/QtDeclarative/bug_997.qml
Normal file
6
tests/QtDeclarative/bug_997.qml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
import Qt 4.7
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: owner.name + " " + owner.phone
|
||||||
|
Component.onCompleted: { owner.newName = owner.name }
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue