thomasvs - in flumotion/trunk: . flumotion/admin/gtk flumotion/test

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Thu Jul 12 23:36:17 CEST 2007


Author: thomasvs
Date: Thu Jul 12 23:36:08 2007
New Revision: 5316

Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/admin/gtk/main.py
   flumotion/trunk/flumotion/admin/gtk/wizard.py
   flumotion/trunk/flumotion/test/gtkunit.py
   flumotion/trunk/flumotion/test/test_greeter.py
   flumotion/trunk/flumotion/test/test_parts.py
   flumotion/trunk/flumotion/test/test_ui_fgtk.py
Log:
	* flumotion/admin/gtk/main.py:
	  Add a FIXME.
	* flumotion/admin/gtk/wizard.py (Wizard, Wizard.finished):
	  Hide when we're finished.
	* flumotion/test/test_greeter.py (WizardTest.testGreeter):
	* flumotion/test/test_ui_fgtk.py (VUTest.testWidget):
	* flumotion/test/test_parts.py (TestAdminStatusbar.tearDown,
	  TestComponentsView.tearDown):
	  iterate the main context to make sure windows unmap during tests
	* flumotion/test/gtkunit.py:
	  remove an unused method



Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Thu Jul 12 23:36:08 2007
@@ -1,3 +1,17 @@
+2007-07-12  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* flumotion/admin/gtk/main.py:
+	  Add a FIXME.
+	* flumotion/admin/gtk/wizard.py (Wizard, Wizard.finished):
+	  Hide when we're finished.
+	* flumotion/test/test_greeter.py (WizardTest.testGreeter):
+	* flumotion/test/test_ui_fgtk.py (VUTest.testWidget):
+	* flumotion/test/test_parts.py (TestAdminStatusbar.tearDown,
+	  TestComponentsView.tearDown):
+	  iterate the main context to make sure windows unmap during tests
+	* flumotion/test/gtkunit.py:
+	  remove an unused method
+
 2007-07-12  Michael Smith <msmith at fluendo.com>
 
 	* flumotion/component/feedcomponent010.py:
@@ -3443,7 +3457,7 @@
 	* flumotion/twisted/flavors.py (StateRemoteCache.invalidate):
 	  Don't use setattr if we don't need to.
 	* flumotion/twisted/rtsp.py (RTSPRequest.process):
-	  Don't trigger and IndexError when there are no headers in the
+	  Don't trigger an IndexError when there are no headers in the
 	  request.
 
 2007-04-07  Thomas Vander Stichele  <thomas at apestaart dot org>

Modified: flumotion/trunk/flumotion/admin/gtk/main.py
==============================================================================
--- flumotion/trunk/flumotion/admin/gtk/main.py	(original)
+++ flumotion/trunk/flumotion/admin/gtk/main.py	Thu Jul 12 23:36:08 2007
@@ -35,6 +35,7 @@
 from flumotion.configure import configure
 from flumotion.twisted import pb as fpb
 
+# FIXME: a function with a capital is extremely poor style.
 def Greeter():
     # We do the import here so gettext has been set up and class strings
     # from greeter are translated

Modified: flumotion/trunk/flumotion/admin/gtk/wizard.py
==============================================================================
--- flumotion/trunk/flumotion/admin/gtk/wizard.py	(original)
+++ flumotion/trunk/flumotion/admin/gtk/wizard.py	Thu Jul 12 23:36:08 2007
@@ -132,6 +132,7 @@
     steps = []
 
     # private
+    # well really, if they're private, why not prefix them with _
     glade_file = 'admin-wizard.glade'
     page = None
     page_stack = []
@@ -273,6 +274,7 @@
         d = defer.Deferred()
         def finished(x):
             self.disconnect(i)
+            self.hide()
             if self.state:
                 d.callback(self.state)
             else:

Modified: flumotion/trunk/flumotion/test/gtkunit.py
==============================================================================
--- flumotion/trunk/flumotion/test/gtkunit.py	(original)
+++ flumotion/trunk/flumotion/test/gtkunit.py	Thu Jul 12 23:36:08 2007
@@ -140,14 +140,6 @@
         timeout_add(gtk.main_quit, increase=False)
         gtk.main()
 
-    def set_widget(self, widget):
-        self.window = gtk.Window()
-        self.widget = widget
-        set_window(self.window)
-        widget.reparent(self.window)
-        self.window.show_all()
-        pause()
-
     def toggle(self, name, process=True):
         """
         toggle a gtk.ToggleButton.

Modified: flumotion/trunk/flumotion/test/test_greeter.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_greeter.py	(original)
+++ flumotion/trunk/flumotion/test/test_greeter.py	Thu Jul 12 23:36:08 2007
@@ -41,7 +41,7 @@
     assert_sensitive('button_next', can_next)
 
 class WizardTest(unittest.TestCase):
-    def testMakeGreeter(self):
+    def testGreeter(self):
         wiz = greeter.Greeter()
         ass = self.assert_
         ass(isinstance(wiz, wizard.Wizard))
@@ -77,8 +77,13 @@
         state = wiz.run()
 
         assert_not_failed()
+        wiz.hide()
+        gtk.main_iteration()
         wiz.destroy()
+        # I don't know why it needs so many, but it seems it does to actually
+        # unmap the window
+        for i in range(1, 32): gtk.main_iteration()
         
         refstate = {'passwd': 'baz', 'host': 'foolio', 'port': 8642,
                     'use_insecure': True, 'user': 'bar'}
-        assert state == refstate
+        self.assertEquals(state, refstate)

Modified: flumotion/trunk/flumotion/test/test_parts.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_parts.py	(original)
+++ flumotion/trunk/flumotion/test/test_parts.py	Thu Jul 12 23:36:08 2007
@@ -44,7 +44,11 @@
         self.bar = parts.AdminStatusbar(self.widget)
 
     def tearDown(self):
+        # the iterations make sure the window goes away
+        self.window.hide()
+        gtk.main_iteration()
         self.window.destroy()
+        gtk.main_iteration()
 
     def testPushRemove(self):
         mid = self.bar.push('main', 'I am a message')
@@ -95,6 +99,13 @@
         self.view = parts.ComponentsView(self.widget)
         gtk.main_iteration()
 
+    def tearDown(self):
+        # the iterations make sure the window goes away
+        self.window.hide()
+        gtk.main_iteration()
+        self.window.destroy()
+        gtk.main_iteration()
+
     def _createComponent(self, dict):
         mstate = planet.ManagerComponentState()
         for key in dict.keys():
@@ -102,9 +113,6 @@
         astate = jelly.unjelly(jelly.jelly(mstate))
         return astate
 
-    def tearDown(self):
-        self.window.destroy()
-
     def testNoneSelected(self):
         self.failIf(self.view.get_selected_name())
 

Modified: flumotion/trunk/flumotion/test/test_ui_fgtk.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_ui_fgtk.py	(original)
+++ flumotion/trunk/flumotion/test/test_ui_fgtk.py	Thu Jul 12 23:36:08 2007
@@ -70,4 +70,9 @@
         gobject.timeout_add(1 * INTERVAL, w.set_property, 'peak', -5.0)
         gobject.timeout_add(2 * INTERVAL, gtk.main_quit)
         gtk.main()
+        # these four calls make sure the window doesn't hang around during
+        # other tests
+        window.hide()
+        gtk.main_iteration()
         window.destroy()
+        gtk.main_iteration()


More information about the flumotion-commit mailing list