@mock.patch('certbot._internal.log.logging.handlers.RotatingFileHandler.doRollover')
@mock.patch('certbot.crypto_util.notAfter')
def test_certonly_renewal_triggers(self, _, __):
    (_, get_utility, _) = self._test_renewal_common(False, ['--dry-run', '--keep'], log_out='simulating renewal')
    self.assertEqual(get_utility().add_message.call_count, 1)
    self.assertTrue(('dry run' in get_utility().add_message.call_args[0][0]))
    self._test_renewal_common(False, ['--renew-by-default', '-tvv', '--debug'], log_out='Auto-renewal forced')
    self.assertEqual(get_utility().add_message.call_count, 1)
    self._test_renewal_common(False, ['-tvv', '--debug', '--keep'], log_out='not yet due', should_renew=False)
@mock.patch('certbot._internal.log.logging.handlers.RotatingFileHandler.doRollover')
@mock.patch('certbot.crypto_util.notAfter')
def test_certonly_renewal_triggers(self, _, __):
    (_, get_utility, _) = self._test_renewal_common(False, ['--dry-run', '--keep'], log_out='simulating renewal')
    self.assertEqual(get_utility().add_message.call_count, 1)
    self.assertTrue(('dry run' in get_utility().add_message.call_args[0][0]))
    self._test_renewal_common(False, ['--renew-by-default', '-tvv', '--debug'], log_out='Auto-renewal forced')
    self.assertEqual(get_utility().add_message.call_count, 1)
    self._test_renewal_common(False, ['-tvv', '--debug', '--keep'], log_out='not yet due', should_renew=False)