fixes for Bug #11199
[wifi-assistant] / package / test / unit / gui / about_dialog_test.py
index a0966f6..a5dcdd4 100644 (file)
@@ -28,15 +28,29 @@ class AboutDialogTest(unittest.TestCase):
         self._makeRunDialogReturn(AboutDialog.DONATE_BUTTON)
         self.testee.show()
         verify(self.launcher).openUrl(AboutDialog.DONATE_URL)
+        
+
+    def test_bug_11199_dialogTitleContainsVersion(self):
+        class checkVersionOnShow():
+            def __init__(self, version):
+                self.version = version
+            def __call__(self, dialog):
+                assert self.version in dialog.get_title()
+        
+        self.testee._runDialog = checkVersionOnShow(AboutDialog.VERSION)
+        self.testee.show()
 
 
     def _makeRunDialogReturn(self, value):
         class method():
-            def __init__(self, value_to_return):
+            def __init__(self, testee, value_to_return):
                 self._value_to_return = value_to_return
-            def __call__(self, x):
-                return self._value_to_return
-        self.testee._runDialog = method(value)
+                self._testee= testee
+            
+            def __call__(self, dialog):
+                self._testee._responseCallback(dialog, self._value_to_return)
+
+        self.testee._runDialog = method(self.testee, value)
         
     
 if __name__ == '__main__':