コード例 #1
0
 def test_get_ext_namespaces_failure(self):
     """
     Test thin._get_ext_namespaces function raises an exception
     if python major/minor version is not configured.
     :return:
     """
     with pytest.raises(salt.exceptions.SaltSystemExit):
         thin._get_ext_namespaces({"ns": {}})
コード例 #2
0
 def test_get_ext_namespaces(self):
     """
     Test thin._get_ext_namespaces function returns namespaces properly out of the config.
     :return:
     """
     cfg = {"ns": {"py-version": [2, 7]}}
     assert thin._get_ext_namespaces(cfg).get("ns") == (2, 7,)
     assert isinstance(thin._get_ext_namespaces(cfg).get("ns"), tuple)
コード例 #3
0
 def test_get_ext_namespaces(self):
     '''
     Test thin._get_ext_namespaces function returns namespaces properly out of the config.
     :return:
     '''
     cfg = {'ns': {'py-version': [2, 7]}}
     assert thin._get_ext_namespaces(cfg).get('ns') == (2, 7,)
     assert isinstance(thin._get_ext_namespaces(cfg).get('ns'), tuple)
コード例 #4
0
 def test_get_ext_namespaces_empty(self):
     """
     Test thin._get_ext_namespaces function returns an empty dictionary on nothing
     :return:
     """
     for obj in [None, {}, []]:
         assert thin._get_ext_namespaces(obj) == {}