/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:14:34 UTC
  • mto: (776.3.1 gpush)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: sinzui.is@verizon.net-20120227201434-l6xney9ewy54ewtl
Added InfoDialog and implemented show_message().

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        self.assertIs(True, ui.PromptDialog.run.called)
80
80
        self.assertIs(False, boolean_value)
81
81
 
 
82
    def test_show_message(self):
 
83
        ui_factory = ui.GtkUIFactory()
 
84
        MockMethod.bind(self, ui.InfoDialog, 'run', Gtk.ResponseType.CLOSE)
 
85
        ui_factory.show_message('test')
 
86
        self.assertIs(True, ui.InfoDialog.run.called)
 
87
 
82
88
    def test_get_password(self):
83
89
        ui_factory = ui.GtkUIFactory()
84
90
        MockMethod.bind(self, ui.PasswordDialog, 'run', Gtk.ResponseType.OK)
160
166
        self.assertEqual('gtk-no', buttons[1].props.label)
161
167
 
162
168
 
 
169
class InfoDialogTestCase(tests.TestCase):
 
170
 
 
171
    def test_init(self):
 
172
        # The label and buttons are created, then shown.
 
173
        dialog = ui.InfoDialog('test 123')
 
174
        self.assertEqual('test 123', dialog.props.text)
 
175
        self.assertEqual(Gtk.MessageType.INFO, dialog.props.message_type)
 
176
        buttons = dialog.get_action_area().get_children()
 
177
        self.assertEqual('gtk-close', buttons[0].props.label)
 
178
 
 
179
 
163
180
class PasswordDialogTestCase(tests.TestCase):
164
181
 
165
182
    def test_init(self):