Exemplo n.º 1
0
def test_util_reg():
    """
    Test to check if registry comes back clean when get_path is called
    """
    mock = MagicMock(return_value={"vdata": ""})
    with patch.dict(win_path.__utils__, {"reg.read_value": mock}):
        assert win_path.get_path() == []
Exemplo n.º 2
0
def test_get_path():
    """
    Test to return the system path
    """
    mock = MagicMock(return_value={"vdata": "C:\\Salt"})
    with patch.dict(win_path.__utils__, {"reg.read_value": mock}):
        assert win_path.get_path() == ["C:\\Salt"]
Exemplo n.º 3
0
 def test_get_path(self):
     """
     Test to Returns the system path
     """
     mock = MagicMock(return_value={"vdata": "C:\\Salt"})
     with patch.dict(win_path.__utils__, {"reg.read_value": mock}):
         self.assertListEqual(win_path.get_path(), ["C:\\Salt"])
Exemplo n.º 4
0
 def test_get_path(self):
     '''
         Test to Returns the system path
     '''
     mock = MagicMock(return_value={'vdata': 'c:\\salt'})
     with patch.dict(win_path.__salt__, {'reg.read_value': mock}):
         self.assertListEqual(win_path.get_path(), ['c:\\salt'])
Exemplo n.º 5
0
 def test_get_path(self):
     """
         Test to Returns the system path
     """
     mock = MagicMock(return_value="c:\\salt")
     with patch.dict(win_path.__salt__, {"reg.read_key": mock}):
         self.assertListEqual(win_path.get_path(), ["c:\\salt"])
Exemplo n.º 6
0
 def test_get_path(self):
     '''
         Test to Returns the system path
     '''
     mock = MagicMock(return_value={'vdata': 'c:\\salt'})
     with patch.dict(win_path.__salt__, {'reg.read_value': mock}):
         self.assertListEqual(win_path.get_path(), ['c:\\salt'])