MCPcopy
hub / github.com/saltstack/salt / test_callbacks

Method test_callbacks

tests/unit/utils/test_process.py:226–239  ·  view source on GitHub ↗

Validate Process call after fork and finalize methods

(self)

Source from the content-addressed store, hash-verified

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"

Callers

nothing calls this directly

Calls 3

runMethod · 0.95
ProcessMethod · 0.80
patchFunction · 0.50

Tested by

no test coverage detected