~ubuntuone-control-tower/ubuntu-sso-client/stable-4-0

« back to all changes in this revision

Viewing changes to ubuntu_sso/utils/webclient/tests/test_qtnetwork.py

  • Committer: Tarmac
  • Author(s): Manuel de la Pena, Rodney Dawes
  • Date: 2012-10-04 19:13:40 UTC
  • mfrom: (973.1.1 update-4-0)
  • Revision ID: tarmac-20121004191340-1afdbrqjgsqiwyfr
[Manuel de la Pena]

    - Set both application and nam proxy to work in all supported Qt versions. (LP: #1061528)

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
 
103
103
        self.patch(qtnetwork, 'build_proxy', fake_build_proxy)
104
104
        qtnetwork.WebClient.proxy_instance = None
 
105
        self.patch(qtnetwork.QNetworkAccessManager, 'setProxy',
 
106
                lambda _, p: self.called.append(('setProxy', p)))
105
107
        self.addCleanup(self._clean_webclient_instance)
106
108
 
107
109
    def _set_old_platform(self, platform):
129
131
        qtnetwork.WebClient()
130
132
        self.assertEqual(self.proxy, qtnetwork.WebClient.proxy_instance)
131
133
        self.assertIn(('setApplicationProxy', self.proxy), self.called)
 
134
        self.assertIn(('setProxy', self.proxy), self.called)
132
135
        self.assertIn(('build_proxy', self.settings), self.called)
133
136
 
134
137
    def test_setup_instance_present(self):
138
141
        qtnetwork.WebClient()
139
142
        self.assertNotEqual(self.proxy, qtnetwork.WebClient.proxy_instance)
140
143
        self.assertNotIn(('setApplicationProxy', self.proxy), self.called)
 
144
        self.assertNotIn(('setProxy', self.proxy), self.called)
141
145
        self.assertNotIn(('build_proxy', self.settings), self.called)
142
146
 
143
147