summaryrefslogtreecommitdiffstats
path: root/tests/test_dialog.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-11-04 20:55:42 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-11-04 20:55:42 +0000
commitd11e86e38a2c215399f3f737bd50dbbb8957f96d (patch)
treee48f791b9ce17edb85e2c4fdcd6d512c1d8deb25 /tests/test_dialog.py
parenteacf5b1d8922bba76038331a072b74c76c185443 (diff)
downloadpygobject-d11e86e38a2c215399f3f737bd50dbbb8957f96d.tar.gz
pygobject-d11e86e38a2c215399f3f737bd50dbbb8957f96d.tar.xz
pygobject-d11e86e38a2c215399f3f737bd50dbbb8957f96d.zip
Use PyTuple_GetSlice and PyArg_ParseTuple here, so we can get the samepygtk-2-4-anchorPYGTK_2_4_1
* gtk/gtk.override (_wrap_gtk_dialog_add_buttons): Use PyTuple_GetSlice and PyArg_ParseTuple here, so we can get the same behavior as in add_button. Reported by Maciej Katafiasz, fixes #156707 * tests/test_dialog.py: Add test for it
Diffstat (limited to 'tests/test_dialog.py')
-rw-r--r--tests/test_dialog.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_dialog.py b/tests/test_dialog.py
new file mode 100644
index 0000000..74fadb7
--- /dev/null
+++ b/tests/test_dialog.py
@@ -0,0 +1,15 @@
+import unittest
+
+from common import gtk
+
+class DialogTest(unittest.TestCase):
+ def testDialogAdd(self):
+ dialog = gtk.MessageDialog()
+
+ # sys.maxint + 1
+ response_id = 2147483648
+ self.assertRaises(OverflowError, dialog.add_button, "Foo", response_id)
+ self.assertRaises(OverflowError, dialog.add_buttons, "Foo", response_id)
+
+if __name__ == '__main__':
+ unittest.main()