~cmiller/desktopcouch/defer-dbus-until-after-plugins

« back to all changes in this revision

Viewing changes to desktopcouch/application/plugins/tests/test_ubuntuone_pairing.py

  • Committer: Chad Miller
  • Date: 2011-04-15 21:43:34 UTC
  • Revision ID: chad.miller@canonical.com-20110415214334-30boo3ubysmrlo74
Save and restore the monkey-patched pair_with_ubuntuone function.  I have no idea how this was working, but tests fail elsewhere.

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
            """Fail if we get called."""
137
137
            self.called = True
138
138
 
 
139
        saved_pair = uone.pair_with_ubuntuone
139
140
        uone.pair_with_ubuntuone = fail_if_called
140
141
        uone.got_new_credentials(self.couchdb_port, self.blocking_semaphores,
141
142
                                 'Unknown App', {})
142
143
        self.assertFalse(self.called, 'pair_with_ubuntuone was not expected.')
143
144
        self.mocker.replay()
 
145
        uone.pair_with_ubuntuone = saved_pair
144
146
 
145
147
    def test_got_new_credentials(self):
146
148
        """Check that pairing is called for Ubuntu One."""
148
150
            """Check that pair_with_ubuntuone was called."""
149
151
            self.called = True
150
152
 
 
153
        saved_pair = uone.pair_with_ubuntuone
151
154
        uone.pair_with_ubuntuone = pass_if_called
152
155
        uone.got_new_credentials(self.couchdb_port, self.blocking_semaphores,
153
156
                                 uone.APP_NAME, {})
154
157
        self.assertTrue(self.called, 'pair_with_ubuntuone was not called.')
155
158
        self.mocker.replay()
 
159
        uone.pair_with_ubuntuone = saved_pair
156
160
 
157
161
    def test_listen_to_dbus(self):
158
162
        """Test that listening to credentails works."""