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)
def test_get_supported_py_config_ext_tops(self): ''' Test collecting proper py-versions. Should return proper ext conf tops. :return: ''' tops = {} ext_cfg = {'solar-interference': {'py-version': [2, 6]}, 'second-system-effect': {'py-version': [2, 7]}} out = salt.utils.stringutils.to_str(thin._get_supported_py_config( tops=tops, extended_cfg=ext_cfg)).strip().split('\n') for t_line in ['second-system-effect:2:7', 'solar-interference:2:6']: assert t_line in out
def test_get_supported_py_config_base_tops(self): ''' Test collecting proper py-versions. Should return proper base tops. :return: ''' tops = {'3': ['/groundkeepers', '/stole'], '2': ['/the-root', '/password']} ext_cfg = {} out = salt.utils.stringutils.to_str(thin._get_supported_py_config( tops=tops, extended_cfg=ext_cfg)).strip().split('\n') assert len(out) == 2 for t_line in ['py3:3:0', 'py2:2:7']: assert t_line in out
def test_get_supported_py_config_base_tops(self): """ Test collecting proper py-versions. Should return proper base tops. :return: """ tops = { "3": ["/groundkeepers", "/stole"], "2": ["/the-root", "/password"] } ext_cfg = {} out = (salt.utils.stringutils.to_str( thin._get_supported_py_config( tops=tops, extended_cfg=ext_cfg)).strip().split(os.linesep)) self.assertEqual(len(out), 2) for t_line in ["py3:3:0", "py2:2:7"]: self.assertIn(t_line, out)
def test_get_supported_py_config_ext_tops(self): """ Test collecting proper py-versions. Should return proper ext conf tops. :return: """ tops = {} ext_cfg = { "solar-interference": {"py-version": [2, 6]}, "second-system-effect": {"py-version": [2, 7]}, } out = ( salt.utils.stringutils.to_str( thin._get_supported_py_config(tops=tops, extended_cfg=ext_cfg) ) .strip() .split(os.linesep) ) for t_line in ["second-system-effect:2:7", "solar-interference:2:6"]: self.assertIn(t_line, out)