summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2005-03-20 20:46:54 +0000
committerJohan Dahlin <johan@src.gnome.org>2005-03-20 20:46:54 +0000
commit4342ab7cd4ac6eed097632e6a1565e56a9086c1e (patch)
treea6146140e0ecc9351c038279cb24591c9239b73d
parent33039b3716cd62744af5d11992a9b22bcb45ce32 (diff)
downloadpygobject-4342ab7cd4ac6eed097632e6a1565e56a9086c1e.tar.gz
Regression, allow the second argument to be unspecified, fixes #171027
* gtk/gtktreeview.override (_wrap_gtk_list_store_insert): Regression, allow the second argument to be unspecified, fixes #171027 (Ulrik Svensson) * tests/test_liststore.py: Add 2 new tests
-rw-r--r--tests/test_liststore.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_liststore.py b/tests/test_liststore.py
new file mode 100644
index 00000000..a5d9f616
--- /dev/null
+++ b/tests/test_liststore.py
@@ -0,0 +1,24 @@
+import unittest
+
+from common import gtk
+
+class ListStoreTest(unittest.TestCase):
+ def testConstructor(self):
+ self.assertRaises(TypeError, gtk.ListStore)
+
+ def testInsert(self):
+ store = gtk.ListStore(int)
+
+ # Old way, with iters
+ store.set_value(store.insert(0), 0, 2)
+ self.assertEqual(len(store), 1)
+ self.assertEqual(store[0][0], 2)
+
+ # New way
+ store.insert(0, (1,))
+ self.assertEqual(len(store), 2)
+ self.assertEqual(store[0][0], 1)
+ self.assertEqual(store[1][0], 2)
+
+if __name__ == '__main__':
+ unittest.main()