예제 #1
0
    def test_double_init_raises_error(self):
        """Ensure initing twice raises a ContextExistsError."""
        from furious. async import Async
        from furious.context._execution import execution_context_from_async
        from furious.errors import ContextExistsError

        execution_context_from_async(Async(target=dir))
        self.assertRaises(ContextExistsError, execution_context_from_async,
                          Async(target=dir))
예제 #2
0
    def test_double_init_raises_error(self):
        """Ensure initing twice raises a ContextExistsError."""
        from furious.async import Async
        from furious.context._execution import execution_context_from_async
        from furious.errors import ContextExistsError

        execution_context_from_async(Async(target=dir))
        self.assertRaises(
            ContextExistsError,
            execution_context_from_async, Async(target=dir))
예제 #3
0
    def test_context_set_on_local_context(self):
        """Ensure the context is set on the local_context."""
        from furious.async import Async
        from furious.context._local import get_local_context
        from furious.context._execution import execution_context_from_async

        context = execution_context_from_async(Async(target=dir))
        self.assertIs(context, get_local_context()._executing_async_context)
예제 #4
0
    def test_context_set_on_local_context(self):
        """Ensure the context is set on the local_context."""
        from furious. async import Async
        from furious.context._local import get_local_context
        from furious.context._execution import execution_context_from_async

        context = execution_context_from_async(Async(target=dir))
        self.assertIs(context, get_local_context()._executing_async_context)