testinggtk r357 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r357 - trunk/tests
- Date: Sun, 3 Aug 2008 23:36:28 +0000 (UTC)
Author: bjornl
Date: Sun Aug 3 23:36:28 2008
New Revision: 357
URL: http://svn.gnome.org/viewvc/testinggtk?rev=357&view=rev
Log:
Reorganizing some tests
Modified:
trunk/tests/test_treeview.py
Modified: trunk/tests/test_treeview.py
==============================================================================
--- trunk/tests/test_treeview.py (original)
+++ trunk/tests/test_treeview.py Sun Aug 3 23:36:28 2008
@@ -260,55 +260,6 @@
view = gtk.TreeView()
view.collapse_row((1, 2, 3))
-def test_set_get_reorderable():
- view = gtk.TreeView()
- assert not view.get_reorderable()
- view.set_reorderable(True)
- assert view.get_reorderable()
- view.set_reorderable(False)
- assert not view.get_reorderable()
-
-def test_set_model_drag_dest_still_reorderable():
- '''
- Ensure that enabling the view to act as a drag destination does
- not unset the ``reorderable`` property.
-
- :bug: #540379
- '''
- view = gtk.TreeView()
- view.set_reorderable(True)
- view.enable_model_drag_dest([], gdk.ACTION_DEFAULT)
- assert view.get_reorderable()
-
-def test_set_model_drag_source_still_reorderable():
- '''
- Ensure that enabling the view to act as a drag source does not
- unset the ``reorderable`` property.
-
- :bug: #540379
- '''
- view = gtk.TreeView()
- view.set_reorderable(True)
- 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
@@ -388,3 +339,55 @@
store = gtk.ListStore(str)
view = gtk.TreeView(store)
view.set_cursor((1,))
+
+######################################################################
+##### Drag-and-drop and reorderability tests #########################
+######################################################################
+def test_set_get_reorderable():
+ view = gtk.TreeView()
+ assert not view.get_reorderable()
+ view.set_reorderable(True)
+ assert view.get_reorderable()
+ view.set_reorderable(False)
+ assert not view.get_reorderable()
+
+def test_set_model_drag_dest_still_reorderable():
+ '''
+ Ensure that enabling the view to act as a drag destination does
+ not unset the ``reorderable`` property.
+
+ :bug: #540379
+ '''
+ view = gtk.TreeView()
+ view.set_reorderable(True)
+ view.enable_model_drag_dest([], gdk.ACTION_DEFAULT)
+ assert view.get_reorderable()
+
+def test_set_model_drag_source_still_reorderable():
+ '''
+ Ensure that enabling the view to act as a drag source does not
+ unset the ``reorderable`` property.
+
+ :bug: #540379
+ '''
+ view = gtk.TreeView()
+ view.set_reorderable(True)
+ 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]