mirror of
https://github.com/certbot/certbot.git
synced 2026-08-04 12:21:51 +02:00
fix fix_test_non_systemd_os_info (#8539)
This commit is contained in:
@@ -547,8 +547,7 @@ class OsInfoTest(unittest.TestCase):
|
|||||||
m_distro.linux_distribution.return_value = ("something", "else")
|
m_distro.linux_distribution.return_value = ("something", "else")
|
||||||
self.assertEqual(cbutil.get_os_info(), ("something", "else"))
|
self.assertEqual(cbutil.get_os_info(), ("something", "else"))
|
||||||
|
|
||||||
@mock.patch("certbot.util.subprocess.Popen")
|
def test_non_systemd_os_info(self):
|
||||||
def test_non_systemd_os_info(self, popen_mock):
|
|
||||||
import certbot.util as cbutil
|
import certbot.util as cbutil
|
||||||
with mock.patch('certbot.util._USE_DISTRO', False):
|
with mock.patch('certbot.util._USE_DISTRO', False):
|
||||||
with mock.patch('platform.system_alias',
|
with mock.patch('platform.system_alias',
|
||||||
@@ -557,6 +556,7 @@ class OsInfoTest(unittest.TestCase):
|
|||||||
|
|
||||||
with mock.patch('platform.system_alias',
|
with mock.patch('platform.system_alias',
|
||||||
return_value=('darwin', '', '')):
|
return_value=('darwin', '', '')):
|
||||||
|
with mock.patch("subprocess.Popen") as popen_mock:
|
||||||
comm_mock = mock.Mock()
|
comm_mock = mock.Mock()
|
||||||
comm_attrs = {'communicate.return_value':
|
comm_attrs = {'communicate.return_value':
|
||||||
('42.42.42', 'error')}
|
('42.42.42', 'error')}
|
||||||
|
|||||||
Reference in New Issue
Block a user