@mock.patch('certbot._internal.cert_manager.lineage_for_certname')
@mock.patch('certbot._internal.main.display_ops.choose_values')
@mock.patch('certbot._internal.main.plug_sel.record_chosen_plugins')
def test_enhance_noninteractive(self, _rec, mock_choose, mock_lineage):
    mock_lineage.return_value = mock.MagicMock(chain_path='/tmp/nonexistent')
    mock_choose.return_value = ['example.com']
    with mock.patch('certbot._internal.main.plug_sel.pick_installer'):
        mock_client = self._call(['enhance', '--redirect', '--hsts', '--non-interactive'])
        self.assertTrue(mock_client.enhance_config.called)
        self.assertFalse(mock_choose.called)
@mock.patch('certbot._internal.cert_manager.lineage_for_certname')
@mock.patch('certbot._internal.main.display_ops.choose_values')
@mock.patch('certbot._internal.main.plug_sel.record_chosen_plugins')
def test_enhance_noninteractive(self, _rec, mock_choose, mock_lineage):
    mock_lineage.return_value = mock.MagicMock(chain_path='/tmp/nonexistent')
    mock_choose.return_value = ['example.com']
    with mock.patch('certbot._internal.main.plug_sel.pick_installer'):
        mock_client = self._call(['enhance', '--redirect', '--hsts', '--non-interactive'])
        self.assertTrue(mock_client.enhance_config.called)
        self.assertFalse(mock_choose.called)