def test_event_with_none_value(self): try: Globalize.event(event=None) except GlobalizeObjectError as e: assert "Cannot globalize target object because it is None object" in str( e ), "It should raise an exception about target object could not be a None object." else: assert False, "It should raise an exception if the value is None."
def test_event_with_normal_value(self): from multiprocessing.synchronize import Event as synchronize_Event from multiprocessing import Event Globalize.event(event=Event()) from multirunnable.api.manage import Running_Event assert isinstance( Running_Event, synchronize_Event ) is True, "It should save instance to the target global variable *Running_Event*."
def globalize_instance(self, obj) -> None: _Globalize.event(event=obj)