@mock.patch('certbot._internal.main.plug_sel.record_chosen_plugins')
@mock.patch('certbot._internal.cert_manager.lineage_for_certname')
@mock.patch('certbot._internal.main.display_ops.choose_values')
@mock.patch('certbot._internal.main._find_domains_or_certname')
def test_selection_auth_warning(self, mock_find, mock_choose, mock_lineage, _rec):
    mock_lineage.return_value = mock.MagicMock(chain_path='/tmp/nonexistent')
    mock_choose.return_value = ['example.com']
    mock_find.return_value = (None, None)
    with mock.patch('certbot._internal.main.plug_sel.pick_installer'):
        with mock.patch('certbot._internal.main.plug_sel.logger.warning') as mock_log:
            mock_client = self._call(['enhance', '-a', 'webroot', '--redirect'])
            self.assertTrue(mock_log.called)
            self.assertTrue(('make sense' in mock_log.call_args[0][0]))
            self.assertTrue(mock_client.enhance_config.called)
@mock.patch('certbot._internal.main.plug_sel.record_chosen_plugins')
@mock.patch('certbot._internal.cert_manager.lineage_for_certname')
@mock.patch('certbot._internal.main.display_ops.choose_values')
@mock.patch('certbot._internal.main._find_domains_or_certname')
def test_selection_auth_warning(self, mock_find, mock_choose, mock_lineage, _rec):
    mock_lineage.return_value = mock.MagicMock(chain_path='/tmp/nonexistent')
    mock_choose.return_value = ['example.com']
    mock_find.return_value = (None, None)
    with mock.patch('certbot._internal.main.plug_sel.pick_installer'):
        with mock.patch('certbot._internal.main.plug_sel.logger.warning') as mock_log:
            mock_client = self._call(['enhance', '-a', 'webroot', '--redirect'])
            self.assertTrue(mock_log.called)
            self.assertTrue(('make sense' in mock_log.call_args[0][0]))
            self.assertTrue(mock_client.enhance_config.called)