aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/qtnetwork/http_test.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/qtnetwork/http_test.py b/tests/qtnetwork/http_test.py
index 28564f5a0..379ff5dfb 100644
--- a/tests/qtnetwork/http_test.py
+++ b/tests/qtnetwork/http_test.py
@@ -8,6 +8,7 @@ from PySide.QtNetwork import *
from helper import UsesQApplication
+"""
class HttpSignalsCase(UsesQApplication):
'''Test case for launching QHttp signals'''
@@ -42,6 +43,24 @@ class testHttp(UsesQApplication):
http.setHost("qtsoftware.com")
http.request(header)
data = http.read(100)
+"""
+
+class testAuthenticationSignal(UsesQApplication):
+ def onAuthRequest(self, hostname, port, auth):
+ self.assert_(isinstance(auth, QAuthenticator))
+ print auth.realm()
+ self._resultOk = True
+ self.app.exit()
+
+ def testwaitSignal(self):
+ self._resultOk = False
+ http = QHttp()
+ http.setHost("projects.maemo.org", QHttp.ConnectionModeHttps, 0)
+ http.connect(SIGNAL("authenticationRequired(const QString&, quint16, QAuthenticator*)"), self.onAuthRequest)
+ path = QUrl.toPercentEncoding("/index.html", "!$&'()*+,;=:@/")
+ print http.get(path)
+ self.app.exec_()
+ self.assert_(self._resultOk)
if __name__ == '__main__':