Esempio 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() == []
Esempio 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"]
Esempio 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"])
Esempio 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'])
Esempio 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"])
Esempio 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'])