+++ /dev/null
-from gnome import gconf
-from wifi_assistant.daemon import Daemon
-from wifi_assistant.gui.about_dialog import AboutDialog
-
-import unittest
-from unit.pie import *
-
-
-
-class AboutDialogTest(unittest.TestCase):
-
- def setUp(self):
- self.launcher = Mock()
- self.launcher.replay()
- self.testee = AboutDialog(self.launcher, None)
-
-
- def test_bugButtonCallsLauncher(self):
- self._makeRunDialogReturn(AboutDialog.BUG_BUTTON)
- self.testee.show()
- verify(self.launcher).openUrl(AboutDialog.BUG_URL)
-
-
- def test_closeButtonDoesntCallLauncher(self):
- self._makeRunDialogReturn(AboutDialog.CLOSE_BUTTON)
- self.testee.show()
- verify(self.launcher, never()).openUrl()
-
-
- def test_donateButtonCallsLauncher(self):
- self._makeRunDialogReturn(AboutDialog.DONATE_BUTTON)
- self.testee.show()
- verify(self.launcher).openUrl(AboutDialog.DONATE_URL)
-
-
- def _makeRunDialogReturn(self, value):
- class method():
- def __init__(self, value_to_return):
- self._value_to_return = value_to_return
- def __call__(self, x):
- return self._value_to_return
- self.testee._runDialog = method(value)
-
-if __name__ == '__main__':
- unittest.main()
-