mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #47982 from twangboy/fix_test_win_dns_client
Fix `unit.modules.test_win_dns_client` tests
This commit is contained in:
commit
9d56af3cad
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user