def test_held(self): ''' Test to set package in 'hold' state, meaning it will not be upgraded. ''' name = 'tmux' ret = {'name': name, 'result': False, 'changes': {}, 'comment': 'Package {0} does not have a state'.format(name)} mock = MagicMock(return_value=False) with patch.dict(aptpkg.__salt__, {'pkg.get_selections': mock}): self.assertDictEqual(aptpkg.held(name), ret)
def test_held(): """ Test to set package in 'hold' state, meaning it will not be upgraded. """ name = "tmux" ret = { "name": name, "result": False, "changes": {}, "comment": "Package {} does not have a state".format(name), } mock = MagicMock(return_value=False) with patch.dict(aptpkg.__salt__, {"pkg.get_selections": mock}): assert aptpkg.held(name) == ret