1 from gnome import gconf
2 from wifi_assistant.daemon import Daemon
3 from wifi_assistant.gui.about_dialog import AboutDialog
10 class AboutDialogTest(unittest.TestCase):
13 self.launcher = Mock()
14 self.launcher.replay()
15 self.testee = AboutDialog(self.launcher, None)
18 def test_bugButtonCallsLauncher(self):
19 self._makeRunDialogReturn(AboutDialog.BUG_BUTTON)
21 verify(self.launcher).openUrl(AboutDialog.BUG_URL)
24 def test_closeButtonDoesntCallLauncher(self):
25 self._makeRunDialogReturn(AboutDialog.CLOSE_BUTTON)
27 verify(self.launcher, never()).openUrl()
30 def test_donateButtonCallsLauncher(self):
31 self._makeRunDialogReturn(AboutDialog.DONATE_BUTTON)
33 verify(self.launcher).openUrl(AboutDialog.DONATE_URL)
36 def _makeRunDialogReturn(self, value):
38 def __init__(self, value_to_return):
39 self._value_to_return = value_to_return
40 def __call__(self, x):
41 return self._value_to_return
42 self.testee._runDialog = method(value)
44 if __name__ == '__main__':