def test_ping(self): ''' Test if it performs a ping to a host. ''' mock = MagicMock(return_value=True) with patch.dict(win_network.__salt__, {'cmd.run': mock}): self.assertTrue(win_network.ping('127.0.0.1'))
def test_ping(): """ Test if it performs a ping to a host. """ mock = MagicMock(return_value=True) with patch.dict(win_network.__salt__, {"cmd.run": mock}): assert win_network.ping("127.0.0.1")