mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #43943 from twangboy/win_unit_test_utils
Fix `unit.utils.test_utils` for Windows
This commit is contained in:
commit
1baf286719
1 changed files with 3 additions and 2 deletions
|
@ -99,7 +99,7 @@ class UtilsTestCase(TestCase):
|
|||
def test_path_join(self):
|
||||
with patch('salt.utils.is_windows', return_value=False) as is_windows_mock:
|
||||
self.assertFalse(is_windows_mock.return_value)
|
||||
expected_path = '/a/b/c/d'
|
||||
expected_path = os.path.join(os.sep + 'a', 'b', 'c', 'd')
|
||||
ret = utils.path_join('/a/b/c', 'd')
|
||||
self.assertEqual(ret, expected_path)
|
||||
|
||||
|
@ -985,7 +985,8 @@ class UtilsTestCase(TestCase):
|
|||
ret = utils.daemonize_if({})
|
||||
self.assertEqual(None, ret)
|
||||
|
||||
with patch('salt.utils.daemonize'):
|
||||
with patch('salt.utils.daemonize'), \
|
||||
patch('sys.platform', 'not windows'):
|
||||
utils.daemonize_if({})
|
||||
self.assertTrue(utils.daemonize.called)
|
||||
# pylint: enable=assignment-from-none
|
||||
|
|
Loading…
Add table
Reference in a new issue