def test_no_spawn_stdin_success(self): cmd = g_commands.ExternalCommand(u"awk '{ exit $0 }'", stdin=u'0', refocus=False, on_success=self.on_success) with self.assertRaises(self.Success): cmd.apply(mock.Mock())
def test_no_spawn_failure(self): ui = mock.Mock() cmd = g_commands.ExternalCommand(u'false', refocus=False, on_success=self.on_success) cmd.apply(ui) ui.notify.assert_called_once_with('', priority='error')
async def test_no_spawn_stdin_attached(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand(u"test -t 0", stdin=u'0', refocus=False) await cmd.apply(ui) ui.notify.assert_called_once_with('', priority='error')
async def test_no_spawn_stdin_success(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand(u"awk '{ exit $0 }'", stdin=u'0', refocus=False) await cmd.apply(ui) ui.notify.assert_not_called()
def test_no_spawn_stdin_attached(self): ui = mock.Mock() cmd = g_commands.ExternalCommand(u"test -t 0", stdin=u'0', refocus=False) cmd.apply(ui) ui.notify.assert_called_once_with('', priority='error')
def test_no_spawn_stdin_success(self): ui = mock.Mock() cmd = g_commands.ExternalCommand(u"awk '{ exit $0 }'", stdin=u'0', refocus=False) cmd.apply(ui) ui.notify.assert_not_called()
async def test_spawn_failure(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand('false', refocus=False, spawn=True) await cmd.apply(ui) ui.notify.assert_called_once_with( 'editor has exited with error code 1 -- No stderr output', priority='error')
async def test_no_spawn_stdin_attached(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand("test -t 0", stdin='0', refocus=False) await cmd.apply(ui) ui.notify.assert_called_once_with( 'editor has exited with error code 1 -- No stderr output', priority='error')
def test_spawn_no_stdin_success(self): ui = mock.Mock() cmd = g_commands.ExternalCommand(u'true', refocus=False, spawn=True) cmd.apply(ui) ui.notify.assert_not_called()
def test_no_spawn_no_stdin_success(self): cmd = g_commands.ExternalCommand(u'true', refocus=False, on_success=self.on_success) with self.assertRaises(self.Success): cmd.apply(mock.Mock())
async def test_spawn_failure(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand(u'false', refocus=False, spawn=True) await cmd.apply(ui) ui.notify.assert_called_once_with('', priority='error')
async def test_spawn_no_stdin_success(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand(u'true', refocus=False, spawn=True) await cmd.apply(ui) ui.notify.assert_not_called()
async def test_no_spawn_no_stdin_attached(self): ui = utilities.make_ui() cmd = g_commands.ExternalCommand(u'test -t 0', refocus=False) await cmd.apply(ui) ui.notify.assert_not_called()
def test_no_spawn_no_stdin_attached(self): ui = mock.Mock() cmd = g_commands.ExternalCommand(u'test -t 0', refocus=False) cmd.apply(ui) ui.notify.assert_not_called()