Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
certbot /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2022-03-20 10:36
display
[ DIR ]
drwxrwxrwx
2022-03-20 10:36
testdata
[ DIR ]
drwxrwxrwx
2022-03-20 10:35
__init__.py
20
B
-rw-r--r--
2018-11-07 22:14
account_test.py
14.36
KB
-rw-r--r--
2018-11-07 22:14
acme_util.py
3.18
KB
-rw-r--r--
2018-11-07 22:14
auth_handler_test.py
23.12
KB
-rw-r--r--
2018-11-07 22:14
cert_manager_test.py
28.09
KB
-rw-r--r--
2018-11-07 22:14
cli_test.py
19.31
KB
-rw-r--r--
2018-11-07 22:14
client_test.py
25.56
KB
-rw-r--r--
2018-11-07 22:14
compat_test.py
736
B
-rw-r--r--
2018-11-07 22:14
configuration_test.py
6.7
KB
-rw-r--r--
2018-11-07 22:14
crypto_util_test.py
13.56
KB
-rw-r--r--
2018-11-07 22:14
eff_test.py
5.94
KB
-rw-r--r--
2018-11-07 22:14
error_handler_test.py
5.31
KB
-rw-r--r--
2018-11-07 22:14
errors_test.py
1.8
KB
-rw-r--r--
2018-11-07 22:14
hook_test.py
16.67
KB
-rw-r--r--
2018-11-07 22:14
lock_test.py
3.84
KB
-rw-r--r--
2018-11-07 22:14
log_test.py
14.92
KB
-rw-r--r--
2018-11-07 22:14
main_test.py
78.7
KB
-rw-r--r--
2018-11-07 22:14
notify_test.py
2.07
KB
-rw-r--r--
2018-11-07 22:14
ocsp_test.py
6.26
KB
-rw-r--r--
2018-11-07 22:14
renewal_test.py
4.18
KB
-rw-r--r--
2020-09-26 20:25
renewupdater_test.py
5.33
KB
-rw-r--r--
2018-11-07 22:14
reporter_test.py
2.73
KB
-rw-r--r--
2018-11-07 22:14
reverter_test.py
18.7
KB
-rw-r--r--
2018-11-07 22:14
storage_test.py
41.53
KB
-rw-r--r--
2018-11-07 22:14
util.py
14.02
KB
-rw-r--r--
2018-11-07 22:14
util_test.py
21.29
KB
-rw-r--r--
2018-11-07 22:14
Save
Rename
"""Tests for renewal updater interfaces""" import unittest import mock from certbot import interfaces from certbot import main from certbot import updater from certbot.plugins import enhancements import certbot.tests.util as test_util class RenewUpdaterTest(test_util.ConfigTestCase): """Tests for interfaces.RenewDeployer and interfaces.GenericUpdater""" def setUp(self): super(RenewUpdaterTest, self).setUp() self.generic_updater = mock.MagicMock(spec=interfaces.GenericUpdater) self.generic_updater.restart = mock.MagicMock() self.renew_deployer = mock.MagicMock(spec=interfaces.RenewDeployer) self.mockinstaller = mock.MagicMock(spec=enhancements.AutoHSTSEnhancement) @mock.patch('certbot.main._get_and_save_cert') @mock.patch('certbot.plugins.selection.choose_configurator_plugins') @mock.patch('certbot.plugins.selection.get_unprepared_installer') @test_util.patch_get_utility() def test_server_updates(self, _, mock_geti, mock_select, mock_getsave): mock_getsave.return_value = mock.MagicMock() mock_generic_updater = self.generic_updater # Generic Updater mock_select.return_value = (mock_generic_updater, None) mock_geti.return_value = mock_generic_updater with mock.patch('certbot.main._init_le_client'): main.renew_cert(self.config, None, mock.MagicMock()) self.assertTrue(mock_generic_updater.restart.called) mock_generic_updater.restart.reset_mock() mock_generic_updater.generic_updates.reset_mock() updater.run_generic_updaters(self.config, mock.MagicMock(), None) self.assertEqual(mock_generic_updater.generic_updates.call_count, 1) self.assertFalse(mock_generic_updater.restart.called) def test_renew_deployer(self): lineage = mock.MagicMock() mock_deployer = self.renew_deployer updater.run_renewal_deployer(self.config, lineage, mock_deployer) self.assertTrue(mock_deployer.renew_deploy.called_with(lineage)) @mock.patch("certbot.updater.logger.debug") def test_updater_skip_dry_run(self, mock_log): self.config.dry_run = True updater.run_generic_updaters(self.config, None, None) self.assertTrue(mock_log.called) self.assertEquals(mock_log.call_args[0][0], "Skipping updaters in dry-run mode.") @mock.patch("certbot.updater.logger.debug") def test_deployer_skip_dry_run(self, mock_log): self.config.dry_run = True updater.run_renewal_deployer(self.config, None, None) self.assertTrue(mock_log.called) self.assertEquals(mock_log.call_args[0][0], "Skipping renewal deployer in dry-run mode.") @mock.patch('certbot.plugins.selection.get_unprepared_installer') def test_enhancement_updates(self, mock_geti): mock_geti.return_value = self.mockinstaller updater.run_generic_updaters(self.config, mock.MagicMock(), None) self.assertTrue(self.mockinstaller.update_autohsts.called) self.assertEqual(self.mockinstaller.update_autohsts.call_count, 1) def test_enhancement_deployer(self): updater.run_renewal_deployer(self.config, mock.MagicMock(), self.mockinstaller) self.assertTrue(self.mockinstaller.deploy_autohsts.called) @mock.patch('certbot.plugins.selection.get_unprepared_installer') def test_enhancement_updates_not_called(self, mock_geti): self.config.disable_renew_updates = True mock_geti.return_value = self.mockinstaller updater.run_generic_updaters(self.config, mock.MagicMock(), None) self.assertFalse(self.mockinstaller.update_autohsts.called) def test_enhancement_deployer_not_called(self): self.config.disable_renew_updates = True updater.run_renewal_deployer(self.config, mock.MagicMock(), self.mockinstaller) self.assertFalse(self.mockinstaller.deploy_autohsts.called) @mock.patch('certbot.plugins.selection.get_unprepared_installer') def test_enhancement_no_updater(self, mock_geti): FAKEINDEX = [ { "name": "Test", "class": enhancements.AutoHSTSEnhancement, "updater_function": None, "deployer_function": "deploy_autohsts", "enable_function": "enable_autohsts" } ] mock_geti.return_value = self.mockinstaller with mock.patch("certbot.plugins.enhancements._INDEX", FAKEINDEX): updater.run_generic_updaters(self.config, mock.MagicMock(), None) self.assertFalse(self.mockinstaller.update_autohsts.called) def test_enhancement_no_deployer(self): FAKEINDEX = [ { "name": "Test", "class": enhancements.AutoHSTSEnhancement, "updater_function": "deploy_autohsts", "deployer_function": None, "enable_function": "enable_autohsts" } ] with mock.patch("certbot.plugins.enhancements._INDEX", FAKEINDEX): updater.run_renewal_deployer(self.config, mock.MagicMock(), self.mockinstaller) self.assertFalse(self.mockinstaller.deploy_autohsts.called) if __name__ == '__main__': unittest.main() # pragma: no cover