From 1063ecd1a4b51e259ef7ababb14d275a3debd021 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Sat, 18 Nov 2006 15:38:46 +0000 Subject: Make sure an exception is raised when we pass in invalid arguments to the * gobject/pygoptiongroup.c (pyg_option_group_dealloc): * tests/test_option.py (TestOption.testBadConstructor): Make sure an exception is raised when we pass in invalid arguments to the optiongroup constructor, add a test. #364576 (Laszlo Pandy) --- tests/test_option.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/test_option.py') diff --git a/tests/test_option.py b/tests/test_option.py index ace7bdb..84e9305 100644 --- a/tests/test_option.py +++ b/tests/test_option.py @@ -28,7 +28,7 @@ class TestOption(unittest.TestCase): parser.add_option("-t", "--test", help="Unit test option", action="store_false", dest="test", default=True) return parser - + def testOption(self): parser = self.setup_parser() group = self.setup_group() @@ -38,3 +38,6 @@ class TestOption(unittest.TestCase): assert group.values.test assert not parser.values.test assert group.values.unit_file == "test" + + def testBadConstructor(self): + self.assertRaises(TypeError, option.OptionGroup) -- cgit