Пример #1
0
class DefaultTest(unittest.TestCase):

    """Test for the alerts."""

    def setUp(self):  # noqa
        self.alert = ZenityAlerts()
        self.alert.run = Mock()
        self.alert.run.return_value = defer.succeed(None)

    def test_info(self):
        """Test showing info."""
        d = self.alert.info("Hi there.")
        d.addCallback(
            lambda ign:
            self.alert.run.assert_called_with("--info", "Hi there."))
        return d
Пример #2
0
 def test_run(self, gpv):
     """Test running."""
     alert = ZenityAlerts()
     alert.run("foo", "bar")
     self.assertEqual(1, gpv.call_count)
Пример #3
0
 def setUp(self):  # noqa
     self.alert = ZenityAlerts()
     self.alert.run = Mock()
     self.alert.run.return_value = defer.succeed(None)