Fixed Http test to work with Qt 4.7.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
parent
c130273ee0
commit
1162a844bd
1 changed files with 4 additions and 6 deletions
|
|
@ -6,18 +6,17 @@ import unittest
|
||||||
from PySide.QtCore import *
|
from PySide.QtCore import *
|
||||||
from PySide.QtNetwork import *
|
from PySide.QtNetwork import *
|
||||||
|
|
||||||
from helper import UsesQApplication
|
from helper import UsesQCoreApplication
|
||||||
from httpd import TestServer
|
from httpd import TestServer
|
||||||
|
|
||||||
class HttpSignalsCase(UsesQApplication):
|
class HttpSignalsCase(UsesQCoreApplication):
|
||||||
'''Test case for launching QHttp signals'''
|
'''Test case for launching QHttp signals'''
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(HttpSignalsCase, self).setUp()
|
super(HttpSignalsCase, self).setUp()
|
||||||
self.http = QHttp()
|
|
||||||
self.httpd = TestServer()
|
self.httpd = TestServer()
|
||||||
self.httpd.start()
|
self.httpd.start()
|
||||||
self.url = QUrl('localhost:' + str(self.httpd.port()))
|
self.http = QHttp('localhost' , self.httpd.port())
|
||||||
self.called = False
|
self.called = False
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
|
@ -34,8 +33,7 @@ class HttpSignalsCase(UsesQApplication):
|
||||||
#QHttp signal requestStarted signal
|
#QHttp signal requestStarted signal
|
||||||
# @bug 114
|
# @bug 114
|
||||||
self.http.requestStarted.connect(self.callback)
|
self.http.requestStarted.connect(self.callback)
|
||||||
self.http.get(self.url.path())
|
self.http.get("index.html")
|
||||||
|
|
||||||
self.app.exec_()
|
self.app.exec_()
|
||||||
self.assert_(self.called)
|
self.assert_(self.called)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue