~ubuntuone-control-tower/ubuntuone-control-panel/trunk

« back to all changes in this revision

Viewing changes to ubuntuone/controlpanel/gui/gtk/tests/__init__.py

  • Committer: Tarmac
  • Author(s): Natalia B. Bidart
  • Date: 2012-02-07 16:04:01 UTC
  • mfrom: (256.1.5 gicrazyness)
  • Revision ID: tarmac-20120207160401-s7plxgq0jalvm264
- Avoid TypeError when fetching credentials in the Gtk OverviewPanel
   (LP: #927743).
- Run the whole test suite with a single command (LP: #927770).
- Do proper cleanup when dealing with UIs (LP: #925617).

Show diffs side-by-side

added added

removed removed

Lines of Context:
202
202
 
203
203
        if self.klass is not None:
204
204
            self.ui = self.klass(**self.kwargs)
 
205
            self.addCleanup(self.ui.destroy)
205
206
 
206
207
        self.memento = MementoHandler()
207
208
        self.memento.setLevel(logging.DEBUG)
208
209
        gui.logger.addHandler(self.memento)
209
210
 
210
 
    @defer.inlineCallbacks
211
 
    def tearDown(self):
212
 
        try:
213
 
            self.ui.hide()
214
 
            del self.ui
215
 
            self.ui = None
216
 
        except AttributeError:
217
 
            pass
218
 
        yield super(BaseTestCase, self).tearDown()
219
 
 
220
211
    def assert_image_equal(self, image, filename):
221
212
        """Check that expected and actual represent the same image."""
222
213
        pb = gui.gtk.gdk.pixbuf_new_from_file(gui.get_data_file(filename))