/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 14:42:57 UTC
  • mto: (776.2.1 ui-factory)
  • mto: This revision was merged to the branch mainline in revision 779.
  • Revision ID: sinzui.is@verizon.net-20120227144257-g5k39febipybqeqv
Added a test for PasswordDialog.

Show diffs side-by-side

added added

removed removed

Lines of Context:
138
138
        self.assertEqual('gtk-yes', buttons[1].props.label)
139
139
        self.assertEqual(
140
140
            Gtk.ResponseType.YES, dialog.get_response_for_widget(buttons[1]))
 
141
 
 
142
 
 
143
class PasswordDialogTestCase(tests.TestCase):
 
144
 
 
145
    def test__init(self):
 
146
        dialog = ui.PasswordDialog('test password')
 
147
        widgets = dialog.get_content_area().get_children()
 
148
        self.assertEqual('test password', widgets[0].props.label)
 
149
        self.assertEqual(False, widgets[1].props.visibility)
 
150
        buttons = dialog.get_action_area().get_children()
 
151
        self.assertEqual('gtk-cancel', buttons[0].props.label)
 
152
        self.assertEqual(
 
153
            Gtk.ResponseType.CANCEL, dialog.get_response_for_widget(buttons[0]))
 
154
        self.assertEqual('gtk-ok', buttons[1].props.label)
 
155
        self.assertEqual(
 
156
            Gtk.ResponseType.OK,
 
157
            dialog.get_response_for_widget(buttons[1]))