Esempio n. 1
0
    def test_queue_with_none_value(self):
        _test_name = "test_name"

        try:
            Globalize.queue(name=_test_name, queue=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."
Esempio n. 2
0
    def test_queue_with_normal_value(self):
        _test_name = "test_name"
        _test_value = "test_value"

        try:
            Globalize.queue(name=_test_name, queue=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."

        Globalize.queue(name=_test_name, queue=_test_value)
        from multirunnable.api.manage import Running_Queue
        assert _test_name in Running_Queue.keys(
        ), f"The testing name '{_test_name}' should be in the keys."
        assert _test_value == Running_Queue[
            _test_name], f"The value should be the same as we set '{_test_value}'."
Esempio n. 3
0
 def globalize_instance(self, obj) -> None:
     _Globalize.queue(name=self._name, queue=obj)