153
153
def test_init(self):
154
154
# The label and buttons are created, then shown.
155
MockMethod.bind(self, Gtk.Box, 'show_all')
156
155
dialog = ui.PromptDialog('test 123')
157
content_area = dialog.get_content_area()
158
self.assertIs(True, dialog.get_content_area().show_all.called)
159
self.assertIs(1, dialog.get_content_area().show_all.call_count)
160
label = content_area.get_children()[0]
161
self.assertEqual('test 123', label.props.label)
156
self.assertEqual('test 123', dialog.props.text)
157
self.assertEqual(Gtk.MessageType.QUESTION, dialog.props.message_type)
162
158
buttons = dialog.get_action_area().get_children()
163
self.assertEqual('gtk-no', buttons[0].props.label)
165
Gtk.ResponseType.NO, dialog.get_response_for_widget(buttons[0]))
166
self.assertEqual('gtk-yes', buttons[1].props.label)
168
Gtk.ResponseType.YES, dialog.get_response_for_widget(buttons[1]))
159
self.assertEqual('gtk-yes', buttons[0].props.label)
160
self.assertEqual('gtk-no', buttons[1].props.label)
171
163
class PasswordDialogTestCase(tests.TestCase):