~ubuntuone-control-tower/ubuntu-sso-client/trunk

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Manuel de la Pena
  • Date: 2012-04-17 14:23:57 UTC
  • mfrom: (943.1.1 remove-duplication)
  • Revision ID: tarmac-20120417142357-4ljl7stfxcr52aaw
- Removed duplicated code from the different webclient implementations (LP: #904842).

Show diffs side-by-side

added added

removed removed

Lines of Context:
689
689
            if expected_value is not ANY_VALUE:
690
690
                self.assertEqual(params[k], expected_value)
691
691
 
 
692
    @defer.inlineCallbacks
692
693
    def test_build_oauth_headers(self):
693
694
        """Check that the oauth headers are properly built."""
694
 
        headers = self.wc.build_oauth_headers(self.sample_method,
695
 
                        self.sample_url, SAMPLE_CREDENTIALS, self.timestamp)
 
695
 
 
696
        def get_timestamp():
 
697
            """Return the timestamp."""
 
698
            return defer.succeed(self.timestamp)
 
699
 
 
700
        self.patch(self.wc, 'get_timestamp', get_timestamp)
 
701
 
 
702
        headers = yield self.wc.build_request_headers(self.sample_url,
 
703
                                         method=self.sample_method,
 
704
                                         oauth_credentials=SAMPLE_CREDENTIALS)
696
705
        self.assert_headers_correct(headers)
697
706
 
698
707
    def test_build_oauth_request(self, params=None):