Mock sys.platform so the test runs on Windows

This commit is contained in:
twangboy 2018-01-19 22:15:13 +00:00
parent 4fdb5cb135
commit 8f2332f45c
No known key found for this signature in database
GPG Key ID: 93FF3BDEB278C9EB

View File

@ -228,7 +228,8 @@ class TestProcess(TestCase):
ret = salt.utils.process.daemonize_if({})
self.assertEqual(None, ret)
with patch('salt.utils.process.daemonize'):
with patch('salt.utils.process.daemonize'), \
patch('sys.platform', 'linux2'):
salt.utils.process.daemonize_if({})
self.assertTrue(salt.utils.process.daemonize.called)
# pylint: enable=assignment-from-none