1 from gnome import gconf
2 from wifi_assistant.gui.about_dialog import AboutDialog
7 class AboutDialogTest(unittest.TestCase):
10 self.launcher = Mock()
11 self.launcher.replay()
12 self.testee = AboutDialog(self.launcher, None)
15 def test_bugButtonCallsLauncher(self):
16 self._makeRunDialogReturn(AboutDialog.BUG_BUTTON)
18 verify(self.launcher).openUrl(AboutDialog.BUG_URL)
21 def test_closeButtonDoesntCallLauncher(self):
22 self._makeRunDialogReturn(AboutDialog.CLOSE_BUTTON)
24 verify(self.launcher, never()).openUrl()
27 def test_donateButtonCallsLauncher(self):
28 self._makeRunDialogReturn(AboutDialog.DONATE_BUTTON)
30 verify(self.launcher).openUrl(AboutDialog.DONATE_URL)
33 def _makeRunDialogReturn(self, value):
35 def __init__(self, value_to_return):
36 self._value_to_return = value_to_return
37 def __call__(self, x):
38 return self._value_to_return
39 self.testee._runDialog = method(value)
42 if __name__ == '__main__':