mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
Enable mypy strict equality checking (#10150)
Fixes one impossible check, but that's it! Closes https://github.com/certbot/certbot/issues/5649.
This commit is contained in:
@@ -140,8 +140,6 @@ def _get_and_save_cert(le_client: client.Client, config: configuration.Namespace
|
||||
)
|
||||
)
|
||||
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
|
||||
if lineage is False:
|
||||
raise errors.Error("Certificate could not be obtained")
|
||||
if lineage is not None:
|
||||
hooks.deploy_hook(config, lineage.names(), lineage.live_dir)
|
||||
renewed_domains.extend(domains)
|
||||
|
||||
@@ -1410,14 +1410,6 @@ class MainTest(test_util.ConfigTestCase):
|
||||
assert 'donate' in mock_register.call_args[0][1]
|
||||
assert mock_subscription.called is True
|
||||
|
||||
@mock.patch('certbot._internal.eff.handle_subscription')
|
||||
def test_certonly_new_request_failure(self, mock_subscription):
|
||||
mock_client = mock.MagicMock()
|
||||
mock_client.obtain_and_enroll_certificate.return_value = False
|
||||
with pytest.raises(errors.Error):
|
||||
self._certonly_new_request_common(mock_client)
|
||||
assert mock_subscription.called is False
|
||||
|
||||
def _test_renewal_common(self, due_for_renewal, extra_args, log_out=None,
|
||||
args=None, should_renew=True, error_expected=False,
|
||||
quiet_mode=False, expiry_date=datetime.datetime.now(),
|
||||
|
||||
@@ -102,7 +102,7 @@ commands = python -m pylint --reports=n --rcfile=.pylintrc {[base]source_paths}
|
||||
deps =
|
||||
{[testenv]deps}
|
||||
-e certbot-ci
|
||||
commands = mypy {[base]source_paths}
|
||||
commands = mypy {[base]source_paths} --strict-equality
|
||||
|
||||
[testenv:isolated-acme]
|
||||
description = Tests acme without any Certbot components installed
|
||||
|
||||
Reference in New Issue
Block a user