mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Force string to ModuleType
This commit is contained in:
parent
84100570f7
commit
2dcdf6788c
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue