@mock.patch('builtins.input', side_effect=KeyboardInterrupt)
@mock.patch('tethys_apps.cli.install_commands.exit')
@mock.patch('tethys_apps.cli.install_commands.get_app_settings')
@mock.patch('tethys_apps.cli.cli_colors.pretty_output')
def test_interactive_custom_setting_interrupt(self, mock_pretty_output, mock_get_settings, mock_exit, _):
    mock_cs = mock.MagicMock()
    mock_cs.name = 'mock_cs'
    mock_get_settings.return_value = {'unlinked_settings': [mock_cs]}
    mock_exit.side_effect = SystemExit
    self.assertRaises(SystemExit, install_commands.run_interactive_services, 'foo')
    po_call_args = mock_pretty_output().__enter__().write.call_args_list
    self.assertIn('Configuring mock_cs', po_call_args[2][0][0])
    self.assertIn('Type', po_call_args[3][0][0])
    self.assertIn('Enter the desired value', po_call_args[4][0][0])
    self.assertEqual('\nInstall Command cancelled.', po_call_args[5][0][0])
    mock_exit.assert_called_with(0)
@mock.patch('builtins.input', side_effect=KeyboardInterrupt)
@mock.patch('tethys_apps.cli.install_commands.exit')
@mock.patch('tethys_apps.cli.install_commands.get_app_settings')
@mock.patch('tethys_apps.cli.cli_colors.pretty_output')
def test_interactive_custom_setting_interrupt(self, mock_pretty_output, mock_get_settings, mock_exit, _):
    mock_cs = mock.MagicMock()
    mock_cs.name = 'mock_cs'
    mock_get_settings.return_value = {'unlinked_settings': [mock_cs]}
    mock_exit.side_effect = SystemExit
    self.assertRaises(SystemExit, install_commands.run_interactive_services, 'foo')
    po_call_args = mock_pretty_output().__enter__().write.call_args_list
    self.assertIn('Configuring mock_cs', po_call_args[2][0][0])
    self.assertIn('Type', po_call_args[3][0][0])
    self.assertIn('Enter the desired value', po_call_args[4][0][0])
    self.assertEqual('\nInstall Command cancelled.', po_call_args[5][0][0])
    mock_exit.assert_called_with(0)