testinggtk r347 - trunk/tests



Author: bjornl
Date: Fri Jul 18 01:30:13 2008
New Revision: 347
URL: http://svn.gnome.org/viewvc/testinggtk?rev=347&view=rev

Log:
Test for the drag lists set up by setting reorderable

Modified:
   trunk/tests/test_treeview.py

Modified: trunk/tests/test_treeview.py
==============================================================================
--- trunk/tests/test_treeview.py	(original)
+++ trunk/tests/test_treeview.py	Fri Jul 18 01:30:13 2008
@@ -325,6 +325,23 @@
     view.enable_model_drag_source(0, [], gdk.ACTION_DEFAULT)
     assert view.get_reorderable()
 
+def test_reorderable_sets_up_drag_lists():
+    '''
+    Ensure that correct drag source and destination lists are set up
+    for the treeview when enabling column reordering.
+    '''
+    view = gtk.TreeView()
+    view.set_reorderable(True)
+
+    target_lists = (view.drag_source_get_target_list(),
+                    view.drag_dest_get_target_list())
+    for targets in target_lists:
+        assert len(targets) == 1
+        drag_type, target_flags, app_id = targets[0]
+        assert drag_type == 'GTK_TREE_MODEL_ROW'
+        assert target_flags == gtk.TARGET_SAME_WIDGET
+        assert app_id == 0
+
 def test_selection_on_popuplated_treeview():
     '''
     If the treeview is populated and realized, then its selection



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