@mock.patch('tethys_apps.cli.install_commands.configure_services')
@mock.patch('tethys_apps.cli.cli_colors.pretty_output')
@mock.patch('tethys_apps.cli.install_commands.open_file')
@mock.patch('tethys_apps.cli.install_commands.os')
def test_run_services(self, mock_os, mock_open_file, mock_pretty_output, _):
    args = mock.MagicMock(services_file='services_file')
    mock_os.path.exists.return_value = True
    mock_open_file.side_effect = ['service_file', '']
    install_commands.run_services('foo', args)
    install_commands.run_services('foo', args)
    po_call_args = mock_pretty_output().__enter__().write.call_args_list
    self.assertEqual('No Services listed in Services file.', po_call_args[0][0][0])
@mock.patch('tethys_apps.cli.install_commands.configure_services')
@mock.patch('tethys_apps.cli.cli_colors.pretty_output')
@mock.patch('tethys_apps.cli.install_commands.open_file')
@mock.patch('tethys_apps.cli.install_commands.os')
def test_run_services(self, mock_os, mock_open_file, mock_pretty_output, _):
    args = mock.MagicMock(services_file='services_file')
    mock_os.path.exists.return_value = True
    mock_open_file.side_effect = ['service_file', ]
    install_commands.run_services('foo', args)
    install_commands.run_services('foo', args)
    po_call_args = mock_pretty_output().__enter__().write.call_args_list
    self.assertEqual('No Services listed in Services file.', po_call_args[0][0][0])