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