~ubuntu-branches/ubuntu/natty/pyside/natty-proposed

« back to all changes in this revision

Viewing changes to tests/QtNetwork/basic_auth_test.py

  • Committer: Bazaar Package Importer
  • Author(s): Didier Raboud
  • Date: 2011-02-18 18:01:00 UTC
  • mfrom: (1.2.3 upstream) (6.1.6 experimental)
  • Revision ID: james.westby@ubuntu.com-20110218180100-vaczjij7g08fzfme
Tags: 1.0.0~rc1-1
* New 1.0.0~rc1 upstream release
  - Bump the B-D chain versions:
    + apiextractor to 0.10.0-2~
    + generatorrunner to 0.6.6
    + shiboken to 1.0.0~rc1
* Update patches to ~rc1.
* debian/watch: update to handle Release Candidates too.
* Bump XS-Python-Version to >= 2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
        self._resultOk = False
16
16
 
17
17
    def tearDown(self):
 
18
        if self.httpd:
 
19
            self.httpd.shutdown()
 
20
            del self.httpd
 
21
        super(testAuthenticationSignal, self).tearDown()
 
22
 
 
23
    def goAway(self):
18
24
        self.httpd.shutdown()
19
 
        del self.httpd
20
 
        super(testAuthenticationSignal, self).tearDown()
 
25
        self.app.quit()
 
26
        self.httpd = None
21
27
 
22
28
    def onAuthRequest(self, hostname, port, auth):
23
29
        self.assert_(isinstance(auth, QAuthenticator))
24
30
        self._resultOk = True
25
 
        self.app.quit()
26
 
 
 
31
        self.goAway()
27
32
 
28
33
    def testwaitSignal(self):
29
 
        http = QHttp()
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", "!$&'()*+,;=:@/")
33
 
        data = http.get(path)
 
37
        data = http.get(str(path))
34
38
        self.app.exec_()
35
39
        self.assert_(self._resultOk)
36
40
 
37
41
    def testwaitSignal2(self):
38
 
        http = QHttp()
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", "!$&'()*+,;=:@/")
43
 
        data = http.get(path)
 
46
        data = http.get(str(path))
44
47
        self.app.exec_()
45
48
        self.assert_(self._resultOk)
46
49