def test_absent(self): ''' Test to ensure that the named host is absent ''' ret = {'changes': {}, 'comment': 'Host salt (127.0.0.1) already absent', 'name': 'salt', 'result': True} mock = MagicMock(return_value=False) with patch.dict(host.__salt__, {'hosts.has_pair': mock}): self.assertDictEqual(host.absent("salt", "127.0.0.1"), ret)
def test_absent(self): ''' Test to ensure that the named host is absent ''' ret = {'changes': {}, 'comment': 'Host salt (127.0.0.1) already absent', 'name': 'salt', 'result': True} mock = MagicMock(return_value=False) with patch.dict(host.__salt__, {'hosts.has_pair': mock}): self.assertDictEqual(host.absent("salt", "127.0.0.1"), ret)
def test_absent(): """ Test to ensure that the named host is absent """ ret = { "changes": {}, "comment": "Host salt (127.0.0.1) already absent", "name": "salt", "result": True, } mock = MagicMock(return_value=False) with patch.dict(host.__salt__, {"hosts.has_pair": mock}): assert host.absent("salt", "127.0.0.1") == ret