testinggtk r115 - trunk/tests
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r115 - trunk/tests
- Date: Sun, 8 Jun 2008 21:30:56 +0000 (UTC)
Author: bjornl
Date: Sun Jun 8 21:30:56 2008
New Revision: 115
URL: http://svn.gnome.org/viewvc/testinggtk?rev=115&view=rev
Log:
Test that page is switched correctly when current page is removed
Modified:
trunk/tests/test_notebook.py
Modified: trunk/tests/test_notebook.py
==============================================================================
--- trunk/tests/test_notebook.py (original)
+++ trunk/tests/test_notebook.py Sun Jun 8 21:30:56 2008
@@ -118,3 +118,20 @@
book.set_current_page(x)
book.remove_page(x)
assert book.get_current_page() == x - 1
+
+def test_next_page_when_current_removed():
+ '''
+ Ensure that when the current page is removed, the page with index
+ one step lower becomes the new active page.
+ '''
+ book = gtk.Notebook()
+ pages = [gtk.Label() for x in range(5)]
+ for page in pages:
+ page.show()
+ book.append_page(page, gtk.Label())
+
+ for x in range(4, 0, -1):
+ book.set_current_page(x)
+ book.remove_page(x)
+ page = book.get_nth_page(book.get_current_page())
+ assert page == pages[x - 1]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]