summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--tests/Makefile.am3
-rw-r--r--tests/test_dialog.py15
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ef0b864..48ab487 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -6,7 +6,7 @@ INCLUDES = \
$(GTK_CFLAGS) \
-I$(top_srcdir)/gobject
-EXTRA_DIST = $(tests) common.py runtests.py
+EXTRA_DIST = $(tests) common.py runtests.py test-thread.h test-unknown.h
noinst_LTLIBRARIES = testhelper.la
linked_LIBS = testhelper.la
@@ -22,6 +22,7 @@ tests = \
conversion.py \
enum.py \
gtype.py \
+ test_dialog.py \
test_signal.py \
test_subtype.py \
test_unknown.py
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()