summaryrefslogtreecommitdiffstats
path: root/tests/QtDeclarative/qdeclarativenetwork_test.py
blob: 459c422b2da2bafefd32dd72b95c35c831d74a4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'''Test cases for QDeclarativeNetwork'''

import unittest

from PySide.QtCore import QUrl
from PySide.QtDeclarative import QDeclarativeView, QDeclarativeNetworkAccessManagerFactory
from PySide.QtNetwork import QNetworkAccessManager

from helper import adjust_filename, TimedQApplication

class TestQDeclarativeNetworkFactory(TimedQApplication):

    def setUp(self):
        TimedQApplication.setUp(self, timeout=1000)

    def testQDeclarativeNetworkFactory(self):
        view = QDeclarativeView()

        url = QUrl.fromLocalFile(adjust_filename('hw.qml', __file__))

        view.setSource(url)
        view.show()

        self.assertEqual(view.status(), QDeclarativeView.Ready)

        self.app.exec_()

if __name__ == '__main__':
    unittest.main()