summaryrefslogtreecommitdiffstats
path: root/tests/QtNetwork/accessManager_test.py
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-05 14:42:39 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-05 14:54:23 -0300
commit53e649629bb0d36cb47bd50e8428ba6e174efa2d (patch)
tree311bfbf44c2c762e34a70d25ebd5526ee1886677 /tests/QtNetwork/accessManager_test.py
parent6383832408576175b60f608e02fa3424f782dbed (diff)
downloadpyside-53e649629bb0d36cb47bd50e8428ba6e174efa2d.tar.gz
pyside-53e649629bb0d36cb47bd50e8428ba6e174efa2d.tar.xz
pyside-53e649629bb0d36cb47bd50e8428ba6e174efa2d.zip
Fixed QtNetwork test to use '127.0.0.1' instead of 'localhost'
This is necessary to make all test to be able run on any buildbot machine. Fix Http server shutdown sequence to avoid deadlocks. Fixes bug #587 Reviewer: Hugo Parente Lima <hugo.lima@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'tests/QtNetwork/accessManager_test.py')
-rw-r--r--tests/QtNetwork/accessManager_test.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/QtNetwork/accessManager_test.py b/tests/QtNetwork/accessManager_test.py
index 172dab8..65a8480 100644
--- a/tests/QtNetwork/accessManager_test.py
+++ b/tests/QtNetwork/accessManager_test.py
@@ -19,20 +19,26 @@ class AccessManagerCase(UsesQCoreApplication):
def tearDown(self):
super(AccessManagerCase, self).tearDown()
+ if self.httpd:
+ self.httpd.shutdown()
+ self.httpd = None
+
+ def goAway(self):
self.httpd.shutdown()
+ self.app.quit()
+ self.httpd = None
def slot_replyFinished(self, reply):
self.assertEqual(type(reply), QNetworkReply)
self.called = True
- self.app.quit()
+ self.goAway()
def testNetworkRequest(self):
manager = QNetworkAccessManager()
manager.finished.connect(self.slot_replyFinished)
- manager.get(QNetworkRequest(QUrl("http://localhost:%s" % self.httpd.port())))
+ manager.get(QNetworkRequest(QUrl("http://127.0.0.1:%s" % self.httpd.port())))
self.app.exec_()
self.assert_(self.called)
- self.httpd.shutdown()
if __name__ == '__main__':
unittest.main()