/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 20:32:57 UTC
  • mto: (776.3.1 gpush)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: sinzui.is@verizon.net-20120227203257-uk0ov2zgg8kg22h1
Added ErrorDialog and implented show_error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
        self.assertEqual('gtk-close', buttons[0].props.label)
88
88
 
89
89
 
 
90
class ErrorDialogTestCase(tests.TestCase):
 
91
 
 
92
    def test_init(self):
 
93
        # The tezt and buttons are created, then shown.
 
94
        dialog = ui.ErrorDialog('test 123')
 
95
        self.assertEqual('test 123', dialog.props.text)
 
96
        self.assertEqual(Gtk.MessageType.ERROR, dialog.props.message_type)
 
97
        buttons = dialog.get_action_area().get_children()
 
98
        self.assertEqual('gtk-close', buttons[0].props.label)
 
99
 
 
100
 
90
101
class PasswordDialogTestCase(tests.TestCase):
91
102
 
92
103
    def test_init(self):
274
285
        ui_factory.show_warning('test')
275
286
        self.assertIs(True, ui.WarningDialog.run.called)
276
287
 
 
288
    def test_show_Error(self):
 
289
        ui_factory = ui.GtkUIFactory()
 
290
        MockMethod.bind(self, ui.ErrorDialog, 'run', Gtk.ResponseType.CLOSE)
 
291
        ui_factory.show_error('test')
 
292
        self.assertIs(True, ui.ErrorDialog.run.called)
 
293
 
277
294
    def test_get_password(self):
278
295
        ui_factory = ui.GtkUIFactory()
279
296
        MockMethod.bind(self, ui.PasswordDialog, 'run', Gtk.ResponseType.OK)