Logo Search packages:      
Sourcecode: ubuntuone-couch version File versions  Download package

def ubuntuone::tests::test_auth::QueryTestCase::test_request (   self )
Test a full request.

Definition at line 110 of file test_auth.py.

                          :
        """Test a full request."""
        mock_get_oauth_credentials = self.mocker.replace(
            'ubuntuone.couch.auth.get_oauth_credentials')
        mock_get_oauth_credentials()
        self.mocker.result({
            u'token': TOKEN_KEY,
            u'token_secret': TOKEN_SECRET,
            u'consumer_key': CONSUMER_KEY,
            u'consumer_secret': CONSUMER_SECRET})
        Http = self.mocker.replace("httplib2.Http")  # pylint: disable=C0103
        http = Http()
        http.request(
            'https://something.one.ubuntu.com/', method='GET', headers=ANY,
            body=None)
        fake_result = ({'status': '200'}, "Totally A-OK!")
        self.mocker.result(fake_result)
        self.mocker.replay()
        result = request('https://something.one.ubuntu.com/')
        self.assertEquals(fake_result, result)


Generated by  Doxygen 1.6.0   Back to index