mirror of
https://github.com/certbot/certbot.git
synced 2026-06-13 18:50:20 -04:00
lint
This commit is contained in:
parent
9201f2691f
commit
7fbd800ddd
1 changed files with 8 additions and 8 deletions
|
|
@ -46,14 +46,14 @@ class HookTest(unittest.TestCase):
|
|||
mockwhich.return_value = None
|
||||
self.assertEqual(hooks._prog("funky"), None)
|
||||
|
||||
@mock.patch('letsencrypt.hooks.logger')
|
||||
def _test_a_hook(self, config, hook_function, calls_expected, mock_logger):
|
||||
mock_logger.warning = mock.MagicMock()
|
||||
with mock.patch('letsencrypt.hooks._run_hook') as mock_run_hook:
|
||||
hook_function(config)
|
||||
hook_function(config)
|
||||
self.assertEqual(mock_run_hook.call_count, calls_expected)
|
||||
return mock_logger.warning
|
||||
def _test_a_hook(self, config, hook_function, calls_expected):
|
||||
with mock.patch('letsencrypt.hooks.logger') as mock_logger:
|
||||
mock_logger.warning = mock.MagicMock()
|
||||
with mock.patch('letsencrypt.hooks._run_hook') as mock_run_hook:
|
||||
hook_function(config)
|
||||
hook_function(config)
|
||||
self.assertEqual(mock_run_hook.call_count, calls_expected)
|
||||
return mock_logger.warning
|
||||
|
||||
def test_pre_hook(self):
|
||||
config = mock.MagicMock(pre_hook="true")
|
||||
|
|
|
|||
Loading…
Reference in a new issue