~mfoord/ubuntu-sso-client/password-policy-error

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Barry Warsaw
  • Date: 2013-02-12 21:09:18 UTC
  • mfrom: (1020.1.3 no-mo-o-auth)
  • Revision ID: tarmac-20130212210918-uhcetgx34k0aw5tx
Remove some unnecessary test code that still depended on python-oauth.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    from urlparse import urlparse, urljoin, parse_qsl
44
44
 
45
45
from OpenSSL import crypto
46
 
from oauth import oauth
47
46
from socket import gethostname
48
47
from twisted.cred import checkers, portal
49
48
from twisted.internet import defer
842
841
 
843
842
    def test_iri_parameters_used_in_oauth_signature(self):
844
843
        """The iri parameters are used in the oauth signature."""
845
 
        from_consumer_and_token = oauth.OAuthRequest.from_consumer_and_token
846
 
 
847
 
        def fake_from_consumer_and_token(parameters=None, **kwargs):
848
 
            """Verify the parameters passed."""
849
 
            self.assertIn("fake_param", parameters)
850
 
            return from_consumer_and_token(
851
 
                                        parameters=parameters, **kwargs)
852
 
 
853
 
        self.patch_staticmethod(oauth.OAuthRequest, "from_consumer_and_token",
854
 
                                fake_from_consumer_and_token)
855
 
 
856
 
        self.sample_url += "?fake_param=fake_value"
857
 
        self.wc.build_oauth_request(self.sample_method, self.sample_url,
858
 
                                    SAMPLE_CREDENTIALS, self.timestamp,
859
 
                                    parameters={})
 
844
        query_url = self.sample_url + "?fake_param=fake_value"
 
845
        url, headers, body = self.wc.build_oauth_request(
 
846
            self.sample_method, query_url,
 
847
            SAMPLE_CREDENTIALS, self.timestamp,
 
848
            parameters={})
 
849
        self.assertEqual(body, {'fake_param': 'fake_value'})
860
850
 
861
851
 
862
852
class OAuthHmacSha1TestCase(OAuthPlainTextTestCase):