Merge pull request #47982 from twangboy/fix_test_win_dns_client

Fix `unit.modules.test_win_dns_client` tests
This commit is contained in:
Nicole Thomas 2018-06-06 11:02:10 -04:00 committed by GitHub
commit 9d56af3cad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ from tests.support.mock import (
# Import Salt Libs
import salt.modules.win_dns_client as win_dns_client
import salt.utils.stringutils
try:
import wmi
@ -73,7 +74,9 @@ class WinDnsClientTestCase(TestCase, LoaderModuleMockMixin):
def setup_loader_modules(self):
# wmi and pythoncom modules are platform specific...
mock_pythoncom = types.ModuleType('pythoncom')
mock_pythoncom = types.ModuleType(
salt.utils.stringutils.to_str('pythoncom')
)
sys_modules_patcher = patch.dict('sys.modules',
{'pythoncom': mock_pythoncom})
sys_modules_patcher.start()