testinggtk r388 - trunk/tests



Author: bjornl
Date: Sat Aug 23 17:32:40 2008
New Revision: 388
URL: http://svn.gnome.org/viewvc/testinggtk?rev=388&view=rev

Log:
Test for creating a spin button with negative number of digits

Modified:
   trunk/tests/test_spinbutton.py

Modified: trunk/tests/test_spinbutton.py
==============================================================================
--- trunk/tests/test_spinbutton.py	(original)
+++ trunk/tests/test_spinbutton.py	Sat Aug 23 17:32:40 2008
@@ -58,6 +58,19 @@
     spin.configure(adj, 1, -10)
     assert spin.get_digits() == 2
 
+def test_init_negative_digits():
+    '''
+    Ensure that a ``TypeError`` is raised when a ``gtk.SpinButton``
+    with a negative number of digits is created. Probably should have
+    been a ``ValueError`` but it is to late to change that now.
+    '''
+    adj = gtk.Adjustment(0, 0, 0, 0, 0, 0)
+    try:
+        spin = gtk.SpinButton(adj, 1, -10)
+        assert False
+    except TypeError:
+        assert True
+
 def test_value_changed_signal():
     '''
     Ensure that the ``value-changed`` signal is properly emitted on a



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]