testinggtk r355 - trunk/tests



Author: bjornl
Date: Sun Aug  3 21:01:20 2008
New Revision: 355
URL: http://svn.gnome.org/viewvc/testinggtk?rev=355&view=rev

Log:
Reorganizing some test cases

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 21:01:20 2008
@@ -233,54 +233,6 @@
     tt = gtk.Tooltip()
     view.emit('query-tooltip', 0, 0, True, tt)
 
- utils pass_on_warnings    
-def test_set_cursor_without_model():
-    '''
-    Ensure that calling ``set_cursor`` on a ``gtk.TreeView`` without a
-    model works as expected. A warning should be shown and
-    ``get_cursor`` should return ``(None, None)``.
-    '''
-    view = gtk.TreeView()
-    view.set_cursor((0, 1, 2, 4, 5))
-    assert view.get_cursor() == (None, None)
-
- utils pass_on_warnings
-def test_set_cursor_on_cell_without_model():
-    '''
-    Calling ``set_cursor_on_cell`` on a ``gtk.TreeView`` without a
-    model results in a GtkWarnings.
-    '''
-    view = gtk.TreeView()
-    view.set_cursor_on_cell((1, 2, 3), start_editing = True)
-
-def test_set_get_cursor():
-    '''
-    Exercise setting and getting the cursor position.
-    '''
-    store = gtk.ListStore(str)
-    for x in range(10):
-        store.append(['str'])
-    view = gtk.TreeView(store)
-    assert view.get_cursor() == (None, None)
-    for x in range(10):
-        view.set_cursor((x,))
-        assert view.get_cursor() == ((x,), None)
-
-def test_set_int_cursor():
-    '''
-    Ensure that an integer can be used as the tree path. This is for
-    backwards compatibility.
-
-    :bug: #350252
-    '''
-    store = gtk.ListStore(str)
-    store.append(['str'])
-    store.append(['str'])
-    view = gtk.TreeView(store)
-    view.set_cursor(1)
-    cursor_path, focus_column = view.get_cursor()
-    assert cursor_path == (1,)
-
 @utils.pass_on_warnings
 def test_scroll_to_cell_without_model():
     '''
@@ -373,3 +325,55 @@
 
     sel = view.get_selection()
     assert sel.get_selected_rows() == (store, [(0,)])
+
+######################################################################
+##### Cursor tests ###################################################
+######################################################################
+ utils pass_on_warnings    
+def test_set_cursor_without_model():
+    '''
+    Ensure that calling ``set_cursor`` on a ``gtk.TreeView`` without a
+    model works as expected. A warning should be shown and
+    ``get_cursor`` should return ``(None, None)``.
+    '''
+    view = gtk.TreeView()
+    view.set_cursor((0, 1, 2, 4, 5))
+    assert view.get_cursor() == (None, None)
+
+ utils pass_on_warnings
+def test_set_cursor_on_cell_without_model():
+    '''
+    Calling ``set_cursor_on_cell`` on a ``gtk.TreeView`` without a
+    model results in a GtkWarnings.
+    '''
+    view = gtk.TreeView()
+    view.set_cursor_on_cell((1, 2, 3), start_editing = True)
+
+def test_set_get_cursor():
+    '''
+    Exercise setting and getting the cursor position.
+    '''
+    store = gtk.ListStore(str)
+    for x in range(10):
+        store.append(['str'])
+    view = gtk.TreeView(store)
+    assert view.get_cursor() == (None, None)
+    for x in range(10):
+        view.set_cursor((x,))
+        assert view.get_cursor() == ((x,), None)
+
+def test_set_int_cursor():
+    '''
+    Ensure that an integer can be used as the tree path. This is for
+    backwards compatibility.
+
+    :bug: #350252
+    '''
+    store = gtk.ListStore(str)
+    store.append(['str'])
+    store.append(['str'])
+    view = gtk.TreeView(store)
+    view.set_cursor(1)
+    cursor_path, focus_column = view.get_cursor()
+    assert cursor_path == (1,)
+



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