Move mocked sleep elsewhere

This commit is contained in:
Seth Schoen 2018-10-16 06:13:13 -07:00
parent ab374c7536
commit e039920a99

View file

@ -68,8 +68,7 @@ class RunTest(test_util.ConfigTestCase):
mock.patch('certbot.main._init_le_client'),
mock.patch('certbot.main._suggest_donation_if_appropriate'),
mock.patch('certbot.main._report_new_cert'),
mock.patch('certbot.main._find_cert'),
mock.patch('certbot.time.sleep')]
mock.patch('certbot.main._find_cert')]
self.mock_auth = self.patches[0].start()
self.mock_success_installation = self.patches[1].start()
@ -78,7 +77,6 @@ class RunTest(test_util.ConfigTestCase):
self.mock_suggest_donation = self.patches[4].start()
self.mock_report_cert = self.patches[5].start()
self.mock_find_cert = self.patches[6].start()
self.mock_sleep = self.patches[7].start()
def tearDown(self):
for patch in self.patches:
@ -519,6 +517,8 @@ class MainTest(test_util.ConfigTestCase): # pylint: disable=too-many-public-met
'--work-dir', self.config.work_dir,
'--logs-dir', self.config.logs_dir, '--text']
self.mock_sleep = mock.patch('certbot.time.sleep').start()
def tearDown(self):
# Reset globals in cli
reload_module(cli)