def test_renew_obtain_cert_error(self):
    self._make_dummy_renewal_config()
    with mock.patch('certbot._internal.storage.RenewableCert') as mock_rc:
        mock_lineage = mock.MagicMock()
        mock_lineage.fullchain = 'somewhere/fullchain.pem'
        mock_rc.return_value = mock_lineage
        mock_lineage.configuration = {'renewalparams': {'authenticator': 'webroot'}}
        with mock.patch('certbot._internal.main.renew_cert') as mock_renew_cert:
            mock_renew_cert.side_effect = Exception
            self._test_renewal_common(True, None, error_expected=True, args=['renew'], should_renew=False)
def test_renew_obtain_cert_error(self):
    self._make_dummy_renewal_config()
    with mock.patch('certbot._internal.storage.RenewableCert') as mock_rc:
        mock_lineage = mock.MagicMock()
        mock_lineage.fullchain = 'somewhere/fullchain.pem'
        mock_rc.return_value = mock_lineage
        mock_lineage.configuration = {'renewalparams': {'authenticator': 'webroot'}}
        with mock.patch('certbot._internal.main.renew_cert') as mock_renew_cert:
            mock_renew_cert.side_effect = Exception
            self._test_renewal_common(True, None, error_expected=True, args=['renew'], should_renew=False)