15
15
self._resultOk = False
17
17
def tearDown(self):
21
super(testAuthenticationSignal, self).tearDown()
18
24
self.httpd.shutdown()
20
super(testAuthenticationSignal, self).tearDown()
22
28
def onAuthRequest(self, hostname, port, auth):
23
29
self.assert_(isinstance(auth, QAuthenticator))
24
30
self._resultOk = True
28
33
def testwaitSignal(self):
30
http.setHost("localhost", self.httpd.port())
34
http = QHttp('127.0.0.1', self.httpd.port())
31
35
http.connect(SIGNAL("authenticationRequired(const QString&, quint16, QAuthenticator*)"), self.onAuthRequest)
32
36
path = QUrl.toPercentEncoding("/index.html", "!$&'()*+,;=:@/")
37
data = http.get(str(path))
35
39
self.assert_(self._resultOk)
37
41
def testwaitSignal2(self):
39
http.setHost("localhost", self.httpd.port())
42
http = QHttp('127.0.0.1', self.httpd.port())
40
43
# Using new signal slot syntax causes a segfault
41
44
http.authenticationRequired.connect(self.onAuthRequest)
42
45
path = QUrl.toPercentEncoding("/index.html", "!$&'()*+,;=:@/")
46
data = http.get(str(path))
45
48
self.assert_(self._resultOk)