~nataliabidart/ubuntuone-control-panel/raise-and-handle-unauthorized

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2011-03-28 18:46:27 UTC
  • mfrom: (113.2.4 stop-backend)
  • Revision ID: tarmac-20110328184627-r2uc8axjc69ivyj3
- Stop the control panel backend once the UI is done (LP: #704434).

Show diffs side-by-side

added added

removed removed

Lines of Context:
278
278
        result = yield self.be.device_is_local(did)
279
279
        self.assertFalse(result)
280
280
 
 
281
    def test_shutdown_func(self):
 
282
        """A shutdown_func can be passed as creation parameter."""
 
283
        f = lambda: None
 
284
        be = backend.ControlBackend(shutdown_func=f)
 
285
        self.assertEqual(be.shutdown_func, f)
 
286
 
 
287
    def test_shutdown_func_is_called_on_shutdown(self):
 
288
        """The shutdown_func is called on shutdown."""
 
289
        self.be.shutdown_func = self._set_called
 
290
        self.be.shutdown()
 
291
        self.assertEqual(self._called, ((), {}))
 
292
 
 
293
    def test_shutdown_func_when_none(self):
 
294
        """The shutdown_func can be None."""
 
295
        self.be.shutdown_func = None
 
296
        self.be.shutdown()
 
297
        # nothing explodes
 
298
 
281
299
 
282
300
class BackendAccountTestCase(BackendBasicTestCase):
283
301
    """Account tests for the backend."""