/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 19:48: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-20120227194838-z857ixpc7mz53eb5
Change PromptDialog to extend GtkMessageDialog that provides icons and text handling for
free.

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
 
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)
164
 
        self.assertEqual(
165
 
            Gtk.ResponseType.NO, dialog.get_response_for_widget(buttons[0]))
166
 
        self.assertEqual('gtk-yes', buttons[1].props.label)
167
 
        self.assertEqual(
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)
169
161
 
170
162
 
171
163
class PasswordDialogTestCase(tests.TestCase):