Code review comment for lp:~cmiller/desktopcouch/defer-dbus-until-after-plugins

Revision history for this message
dobey (dobey) wrote :

Something very weird is going on in the tests here. This change seems to fix it here:

=== modified file 'desktopcouch/application/plugins/tests/test_ubuntuone_pairing.py'
--- desktopcouch/application/plugins/tests/test_ubuntuone_pairing.py 2011-04-13 21:31:15 +0000
+++ desktopcouch/application/plugins/tests/test_ubuntuone_pairing.py 2011-04-15 01:56:27 +0000
@@ -136,11 +136,13 @@ class TestUbuntuOnePlugin(MockerTestCase
             """Fail if we get called."""
             self.called = True

+ old_pair = uone.pair_with_ubuntuone
         uone.pair_with_ubuntuone = fail_if_called
         uone.got_new_credentials(self.couchdb_port, self.blocking_semaphores,
                                  'Unknown App', {})
         self.assertFalse(self.called, 'pair_with_ubuntuone was not expected.')
         self.mocker.replay()
+ uone.pair_with_ubuntuone = old_pair

     def test_got_new_credentials(self):
         """Check that pairing is called for Ubuntu One."""
@@ -148,11 +150,13 @@ class TestUbuntuOnePlugin(MockerTestCase
             """Check that pair_with_ubuntuone was called."""
             self.called = True

+ old_pair = uone.pair_with_ubuntuone
         uone.pair_with_ubuntuone = pass_if_called
         uone.got_new_credentials(self.couchdb_port, self.blocking_semaphores,
                                  uone.APP_NAME, {})
         self.assertTrue(self.called, 'pair_with_ubuntuone was not called.')
         self.mocker.replay()
+ uone.pair_with_ubuntuone = old_pair

     def test_listen_to_dbus(self):
         """Test that listening to credentails works."""

« Back to merge proposal