示例#1
0
 def test_condition_with_none_value(self):
     try:
         Globalize.condition(condition=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."
示例#2
0
    def test_condition_with_normal_value(self):
        from multiprocessing.synchronize import Condition as synchronize_Condition
        from multiprocessing import Condition

        Globalize.condition(condition=Condition())
        from multirunnable.api.manage import Running_Condition
        assert isinstance(
            Running_Condition, synchronize_Condition
        ) is True, "It should save instance to the target global variable *Running_Condition*."
示例#3
0
 def globalize_instance(self, obj) -> None:
     _Globalize.condition(condition=obj)