summaryrefslogtreecommitdiffstats
path: root/tests/QtDeclarative/qdeclarativeview_test.py
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-06-07 14:43:45 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-06-07 16:57:11 -0300
commitab918abc1e103e0ca86939f7d057e8a44ac8a4ef (patch)
tree53c6f57d089dcf5e145d766b1ceef704714046d8 /tests/QtDeclarative/qdeclarativeview_test.py
parent471486732b03cbb42b884158604a59d5a18e8a35 (diff)
downloadpyside-ab918abc1e103e0ca86939f7d057e8a44ac8a4ef.tar.gz
pyside-ab918abc1e103e0ca86939f7d057e8a44ac8a4ef.tar.xz
pyside-ab918abc1e103e0ca86939f7d057e8a44ac8a4ef.zip
Created new unittest model.
Separete unittest for module. Only run unittest for compiled modules. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>, Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests/QtDeclarative/qdeclarativeview_test.py')
-rw-r--r--tests/QtDeclarative/qdeclarativeview_test.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/QtDeclarative/qdeclarativeview_test.py b/tests/QtDeclarative/qdeclarativeview_test.py
new file mode 100644
index 0000000..8101c5f
--- /dev/null
+++ b/tests/QtDeclarative/qdeclarativeview_test.py
@@ -0,0 +1,31 @@
+'''Test cases for QDeclarativeView'''
+
+import unittest
+
+from PySide.QtCore import QUrl, QStringList, QVariant
+from PySide.QtGui import QPushButton
+from PySide.QtDeclarative import QDeclarativeView
+
+from helper import adjust_filename, TimedQApplication
+
+
+class TestQDeclarativeView(TimedQApplication):
+
+ def testQDeclarativeViewList(self):
+ view = QDeclarativeView()
+
+ dataList = QStringList(["Item 1", "Item 2", "Item 3", "Item 4"])
+
+ ctxt = view.rootContext()
+ ctxt.setContextProperty("myModel", dataList)
+
+ url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
+ view.setSource(url)
+ view.show()
+
+ self.assertEqual(view.status(), QDeclarativeView.Ready)
+
+ self.app.exec_()
+
+if __name__ == '__main__':
+ unittest.main()