~ubuntu-branches/ubuntu/trusty/ubuntuone-control-panel/trusty

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/tests/test_web_client.py

  • Committer: Package Import Robot
  • Author(s): Rodney Dawes
  • Date: 2013-06-05 11:41:44 UTC
  • mfrom: (1.1.46)
  • Revision ID: package-import@ubuntu.com-20130605114144-s83ih8jdsecbpr6u
Tags: 13.05-0ubuntu1
* New upstream release.
* debian/watch:
  - Update watch file for new series.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    'oauth_signature_method=HMAC-SHA1&next=%%2Fblah&oauth_version=1.0&' \
53
53
    'oauth_token=%s&oauth_signature=s6h0LRBiWchTADrTJWaJUSuaGpo3D' % \
54
54
    (SAMPLE_CREDENTIALS['consumer_key'], SAMPLE_CREDENTIALS['token'])
 
55
FAKE_TIMESTAMP = 1
55
56
 
56
57
 
57
58
def sample_get_credentials():
108
109
        self.base_iri = self.ws.get_iri()
109
110
 
110
111
        self.wc = WebClient(sample_get_credentials, base_url=self.base_iri)
 
112
        self.patch(self.wc.wc, "get_timestamp", self.fake_get_timestamp)
111
113
        self.addCleanup(self.wc.shutdown)
112
114
 
 
115
    def fake_get_timestamp(self):
 
116
        """A fake get_timestamp."""
 
117
        return defer.succeed(FAKE_TIMESTAMP)
 
118
 
113
119
    def test_correct_app_name(self):
114
120
        """Assert that the wc uses the correct appname."""
115
121
        self.assertEqual(APP_NAME, self.wc.wc.appname)