@mock.patch('builtins.open', side_effect=IOError('test'))
@mock.patch('tethys_apps.cli.install_commands.exit')
@mock.patch('tethys_apps.cli.cli_colors.pretty_output')
def test_open_file_error(self, mock_pretty_output, mock_exit, _):
    mock_exit.side_effect = SystemExit
    self.assertRaises(SystemExit, install_commands.open_file, 'foo')
    po_call_args = mock_pretty_output().__enter__().write.call_args_list
    self.assertEqual('test', po_call_args[0][0][0])
    self.assertIn('An unexpected error occurred reading the file.', po_call_args[1][0][0])
    mock_exit.assert_called_with(1)
@mock.patch('builtins.open', side_effect=IOError('test'))
@mock.patch('tethys_apps.cli.install_commands.exit')
@mock.patch('tethys_apps.cli.cli_colors.pretty_output')
def test_open_file_error(self, mock_pretty_output, mock_exit, _):
    mock_exit.side_effect = SystemExit
    self.assertRaises(SystemExit, install_commands.open_file, 'foo')
    po_call_args = mock_pretty_output().__enter__().write.call_args_list
    self.assertEqual('test', po_call_args[0][0][0])
    self.assertIn('An unexpected error occurred reading the file.', po_call_args[1][0][0])
    mock_exit.assert_called_with(1)