/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_ui.py

  • Committer: Curtis Hovey
  • Date: 2012-02-27 21:07:38 UTC
  • mto: (776.3.1 gpush)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: sinzui.is@verizon.net-20120227210738-f5vb56xm2k2ii19j
Added show_user_warning implementation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
291
291
        ui_factory.show_error('test')
292
292
        self.assertIs(True, ui.ErrorDialog.run.called)
293
293
 
 
294
    def test_show_user_warning(self):
 
295
        ui_factory = ui.GtkUIFactory()
 
296
        MockMethod.bind(self, ui.WarningDialog, 'run', Gtk.ResponseType.CLOSE)
 
297
        ui_factory.show_user_warning(
 
298
            'recommend_upgrade', current_format_name='1.0', basedir='./test')
 
299
        self.assertIs(True, ui.WarningDialog.run.called)
 
300
 
 
301
    def test_show_user_warning_supressed(self):
 
302
        ui_factory = ui.GtkUIFactory()
 
303
        ui_factory.suppressed_warnings.add('recommend_upgrade')
 
304
        MockMethod.bind(self, ui.WarningDialog, 'run', Gtk.ResponseType.CLOSE)
 
305
        ui_factory.show_user_warning(
 
306
            'recommend_upgrade', current_format_name='1.0', basedir='./test')
 
307
        self.assertIs(False, ui.WarningDialog.run.called)
 
308
 
294
309
    def test_get_password(self):
295
310
        ui_factory = ui.GtkUIFactory()
296
311
        MockMethod.bind(self, ui.PasswordDialog, 'run', Gtk.ResponseType.OK)