From 0b5df9049ad0e4e060ec25448c8c3c384d701dcc Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Mon, 24 Feb 2020 20:14:15 +0100 Subject: [PATCH] Fix hook test --- certbot/tests/compat/misc_test.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/certbot/tests/compat/misc_test.py b/certbot/tests/compat/misc_test.py index 199f09999..539bf912d 100644 --- a/certbot/tests/compat/misc_test.py +++ b/certbot/tests/compat/misc_test.py @@ -2,6 +2,7 @@ import mock import unittest +from certbot.compat import os class ExecuteTest(unittest.TestCase): """Tests for certbot.compat.misc.execute_command.""" @@ -28,7 +29,11 @@ class ExecuteTest(unittest.TestCase): executed_command = mock_popen.call_args[1].get( "args", mock_popen.call_args[0][0]) - self.assertEqual(executed_command, given_command) + if os.name == 'nt': + expected_command = ['powershell.exe', '-Command', given_command] + else: + expected_command = given_command + self.assertEqual(executed_command, expected_command) mock_logger.info.assert_any_call("Running %s command: %s", given_name, given_command)