Validate Process call after fork and finalize methods
(self)
| 224 | evt.set() |
| 225 | |
| 226 | def test_callbacks(self): |
| 227 | "Validate Process call after fork and finalize methods" |
| 228 | with patch( |
| 229 | "salt._logging.get_logging_options_dict", return_value={"1": 1} |
| 230 | ) as ls1, patch("salt._logging.setup_logging") as ls2, patch( |
| 231 | "salt._logging.shutdown_logging" |
| 232 | ) as ls3: |
| 233 | evt = multiprocessing.Event() |
| 234 | proc = salt.utils.process.Process(target=self.process_target, args=(evt,)) |
| 235 | proc.run() |
| 236 | assert evt.is_set() |
| 237 | ls1.assert_called() |
| 238 | ls2.assert_called() |
| 239 | ls3.assert_called() |
| 240 | |
| 241 | def test_callbacks_called_when_run_overridden(self): |
| 242 | "Validate Process sub classes call after fork and finalize methods when run is overridden" |