Exemplo n.º 1
0
def test_env_is_exposed_whitelist():
    with patch.dict(
            hgfs.__opts__,
        {
            "hgfs_saltenv_whitelist": "base",
            "hgfs_saltenv_blacklist": ""
        },
    ):
        hgfs.init()
        hgfs.update()
        assert hgfs._env_is_exposed("base") is True
        assert hgfs._env_is_exposed("test") is False
        assert hgfs._env_is_exposed("unset") is False
Exemplo n.º 2
0
 def test_env_is_exposed_blacklist(self):
     '''
     test _env_is_exposed method when
     base is in blacklist
     '''
     with patch.dict(hgfs.__opts__,
                     {'hgfs_saltenv_whitelist': '',
                      'hgfs_saltenv_blacklist': 'base'}):
         assert not hgfs._env_is_exposed('base')
Exemplo n.º 3
0
 def test_env_is_exposed_blacklist(self):
     """
     test _env_is_exposed method when
     base is in blacklist
     """
     with patch.dict(
         hgfs.__opts__,
         {"hgfs_saltenv_whitelist": "", "hgfs_saltenv_blacklist": "base"},
     ):
         assert not hgfs._env_is_exposed("base")