Created unit test for bug #951.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
7942a9053d
commit
a87d114210
3 changed files with 39 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ PYSIDE_TEST(bug_825.py)
|
||||||
PYSIDE_TEST(bug_847.py)
|
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(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)
|
||||||
|
|
|
||||||
31
tests/QtDeclarative/bug_951.py
Normal file
31
tests/QtDeclarative/bug_951.py
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
from PySide.QtDeclarative import QDeclarativeItem, qmlRegisterType, QDeclarativeView
|
||||||
|
from PySide.QtCore import QUrl
|
||||||
|
|
||||||
|
from helper import adjust_filename, TimedQApplication
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
class MyItem(QDeclarativeItem):
|
||||||
|
COMPONENT_COMPLETE_CALLED = False
|
||||||
|
def __init__(self,parent=None):
|
||||||
|
super(MyItem, self).__init__(parent)
|
||||||
|
self.setObjectName("myitem")
|
||||||
|
|
||||||
|
def componentComplete(self):
|
||||||
|
MyItem.COMPONENT_COMPLETE_CALLED = True
|
||||||
|
super(MyItem, self).componentComplete()
|
||||||
|
|
||||||
|
class TestRegisterQMLType(TimedQApplication):
|
||||||
|
def setup(self):
|
||||||
|
TimedQApplication.setup(self, 100 * 3) # 3s
|
||||||
|
|
||||||
|
def testSignalEmission(self):
|
||||||
|
qmlRegisterType(MyItem, "my.item", 1, 0, "MyItem")
|
||||||
|
|
||||||
|
view = QDeclarativeView()
|
||||||
|
view.setSource(QUrl.fromLocalFile(adjust_filename('bug_951.qml', __file__)))
|
||||||
|
|
||||||
|
self.app.exec_()
|
||||||
|
self.assertTrue(MyItem.COMPONENT_COMPLETE_CALLED)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
7
tests/QtDeclarative/bug_951.qml
Normal file
7
tests/QtDeclarative/bug_951.qml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import Qt 4.7
|
||||||
|
import my.item 1.0
|
||||||
|
Rectangle{
|
||||||
|
width:10
|
||||||
|
height:10
|
||||||
|
MyItem{ }
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue