@mock.patch('certbot._internal.main.plug_sel.record_chosen_plugins')
@mock.patch('certbot._internal.main.plug_sel.pick_installer')
@mock.patch('certbot._internal.cert_manager.get_certnames')
@mock.patch('certbot._internal.main._install_cert')
def test_installer_select_cert(self, mock_inst, mock_getcert, _inst, _rec):
    mock_lineage = mock.MagicMock(cert_path=test_util.temp_join('cert'), chain_path=test_util.temp_join('chain'), fullchain_path=test_util.temp_join('chain'), key_path=test_util.temp_join('privkey'))
    with mock.patch('certbot._internal.cert_manager.lineage_for_certname') as mock_getlin:
        mock_getlin.return_value = mock_lineage
        self._call(['install'], mockisfile=True)
    self.assertTrue(mock_getcert.called)
    self.assertTrue(mock_inst.called)
@mock.patch('certbot._internal.main.plug_sel.record_chosen_plugins')
@mock.patch('certbot._internal.main.plug_sel.pick_installer')
@mock.patch('certbot._internal.cert_manager.get_certnames')
@mock.patch('certbot._internal.main._install_cert')
def test_installer_select_cert(self, mock_inst, mock_getcert, _inst, _rec):
    mock_lineage = mock.MagicMock(cert_path=test_util.temp_join('cert'), chain_path=test_util.temp_join('chain'), fullchain_path=test_util.temp_join('chain'), key_path=test_util.temp_join('privkey'))
    with mock.patch('certbot._internal.cert_manager.lineage_for_certname') as mock_getlin:
        mock_getlin.return_value = mock_lineage
        self._call(['install'], mockisfile=True)
    self.assertTrue(mock_getcert.called)
    self.assertTrue(mock_inst.called)