mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Add unit test for get_supported_py_config function typecheck
This commit is contained in:
parent
f833d18fd1
commit
a284d73e1f
@ -307,7 +307,7 @@ def _get_supported_py_config(tops, extended_cfg):
|
||||
elif py_ver == 3:
|
||||
pymap.append('py3:3:0')
|
||||
|
||||
for ns, cfg in _six.iteritems(get_ext_tops(copy.deepcopy(extended_cfg) or {})):
|
||||
for ns, cfg in _six.iteritems(copy.deepcopy(extended_cfg) or {}):
|
||||
pymap.append('{}:{}:{}'.format(ns, *cfg.get('py-version')))
|
||||
pymap.append('')
|
||||
|
||||
|
@ -570,3 +570,13 @@ class SSHThinTestCase(TestCase):
|
||||
assert arcname in files
|
||||
files.pop(files.index(arcname))
|
||||
assert not bool(files)
|
||||
|
||||
def test_get_supported_py_config_typecheck(self):
|
||||
'''
|
||||
Test collecting proper py-versions. Should return bytes type.
|
||||
:return:
|
||||
'''
|
||||
tops = {}
|
||||
ext_cfg = {}
|
||||
out = thin._get_supported_py_config(tops=tops, extended_cfg=ext_cfg)
|
||||
assert type(salt.utils.stringutils.to_bytes('')) == type(out)
|
||||
|
Loading…
Reference in New Issue
Block a user