mirror of
https://github.com/certbot/certbot.git
synced 2026-06-08 16:22:18 -04:00
Add bad domain renew test
This commit is contained in:
parent
d6e207e912
commit
0ba4b0c0b5
1 changed files with 16 additions and 0 deletions
|
|
@ -657,6 +657,22 @@ class CLITest(unittest.TestCase): # pylint: disable=too-many-public-methods
|
|||
args=['renew'], renew=False)
|
||||
self.assertFalse(mock_obtain_cert.called)
|
||||
|
||||
def test_renew_with_bad_domain(self):
|
||||
renewer_configs_dir = os.path.join(self.config_dir, 'renewal')
|
||||
os.makedirs(renewer_configs_dir)
|
||||
with open(os.path.join(renewer_configs_dir, 'test.conf'), 'w') as f:
|
||||
f.write("My contents don't matter")
|
||||
with mock.patch('letsencrypt.storage.RenewableCert') as mock_rc:
|
||||
mock_lineage = mock.MagicMock()
|
||||
mock_rc.return_value = mock_lineage
|
||||
mock_rc.names.return_value = ['*.example.com']
|
||||
mock_lineage.configuration = {
|
||||
'renewalparams': {'authenticator': None}}
|
||||
with mock.patch('letsencrypt.cli.obtain_cert') as mock_obtain_cert:
|
||||
self._test_renewal_common(True, None,
|
||||
args=['renew'], renew=False)
|
||||
self.assertFalse(mock_obtain_cert.called)
|
||||
|
||||
@mock.patch('letsencrypt.cli.zope.component.getUtility')
|
||||
@mock.patch('letsencrypt.cli._treat_as_renewal')
|
||||
@mock.patch('letsencrypt.cli._init_le_client')
|
||||
|
|
|
|||
Loading…
Reference in a new issue