def test_stop(self): """ Test for Stops service via daemontools """ mock = MagicMock(return_value=None) with patch.dict(daemontools.__salt__, {"file.touch": mock}): mock = MagicMock(return_value="") with patch.object(daemontools, "_service_path", mock): mock = MagicMock(return_value=False) with patch.dict(daemontools.__salt__, {"cmd.retcode": mock}): self.assertTrue(daemontools.stop("name"))
def test_stop(self): ''' Test for Stops service via daemontools ''' mock = MagicMock(return_value=None) with patch.dict(daemontools.__salt__, {'file.touch': mock}): mock = MagicMock(return_value='') with patch.object(daemontools, '_service_path', mock): mock = MagicMock(return_value=False) with patch.dict(daemontools.__salt__, {'cmd.retcode': mock}): self.assertTrue(daemontools.stop('name'))