~ubuntu-branches/ubuntu/trusty/desktopcouch/trusty

« back to all changes in this revision

Viewing changes to desktopcouch/tests/test_start_local_couchdb.py

  • Committer: Bazaar Package Importer
  • Author(s): Chad MILLER
  • Date: 2010-09-28 09:25:07 UTC
  • Revision ID: james.westby@ubuntu.com-20100928092507-yk2ggp0w4ipzq2gh
* New upstream release.
  - Use the new Ubuntu-SSO package to get credentials to use to replicate
    with Ubuntu One couchdb. (LP: #649320)
  - Be more relisient by trying to restart couchdb when it crashes.  Do
    this by passing a proxy object in place of lower-level view objects,
    and on access and failure, reconnect. (LP: #522538)
* Begin to Recommend ubuntu-sso-client, so ubuntuone replication will
  work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
        mocker.restore()
138
138
        mocker.verify()
139
139
 
140
 
    def test_pair_ubuntuone(self):
 
140
    def test_pair_ubuntuone_with_sso(self):
141
141
        """ Test the pairing with ubuntu one.
142
142
        
143
143
        Ensure that the pair ubuntu one method is called when we do have
158
158
        update_pairing_service(sso_mock)
159
159
        mocker.verify()
160
160
 
 
161
    def test_pair_ubuntuone_without_sso(self):
 
162
        """ Test the pairing with ubuntu one.
 
163
        
 
164
        Ensure that the pair ubuntu one method is called when we do have
 
165
        credentials.
 
166
        """
 
167
        from desktopcouch.start_local_couchdb import update_pairing_service
 
168
        mocker = Mocker()
 
169
        pair_ubuntu_one_mock = mocker.replace(
 
170
            'desktopcouch.pair.couchdb_pairing.' + 
 
171
            'ubuntuone_pairing.pair_with_ubuntuone')
 
172
        # make the sso credentials return a dictionary with fake data
 
173
        mocker.result({'fake':'credential'})
 
174
        # pair with ubuntu one never called!
 
175
        mocker.replay()
 
176
        # call the start method to ensure that the methods are correctly called
 
177
        update_pairing_service(sso=None, test_import_fails=True)
 
178
        mocker.verify()
 
179