def test_alert_linux(self, echo_mock, shell_mock): config = CliRuntime() config.alert("hello") echo_mock.assert_called_once() shell_mock.assert_called_once() self.assertIn("notify-send", shell_mock.call_args[0][0])
def test_alert__disabled(self, echo_mock, shell_mock): config = CliRuntime() config.project_config.dev_config__no_alert = True config.alert("hello") echo_mock.assert_not_called() shell_mock.assert_not_called()
def test_alert_osx(self, echo_mock, shell_mock): config = CliRuntime() config.alert("hello") echo_mock.assert_called_once() shell_mock.assert_called_once() self.assertIn("osascript", shell_mock.call_args[0][0])
def test_alert__os_error(self, echo_mock, shell_mock): shell_mock.side_effect = OSError config = CliRuntime() config.alert("hello") echo_mock.assert_called_once() shell_mock.assert_called_once()