From 1551821972882def5738220112c3a7487ab80edf Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Fri, 7 May 2010 10:50:41 -0300 Subject: uinit test for signasl with valuetype as pointer. Reviewer: Hugo Parente Lima , Luciano Wolf --- tests/qtnetwork/http_test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') 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__': -- cgit v1.2.3