From d11e86e38a2c215399f3f737bd50dbbb8957f96d Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Thu, 4 Nov 2004 20:55:42 +0000 Subject: Use PyTuple_GetSlice and PyArg_ParseTuple here, so we can get the same * 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 --- tests/Makefile.am | 3 ++- tests/test_dialog.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tests/test_dialog.py 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() -- cgit