3.0.ipv8.test.test_taskmanager ============================== .. py:module:: 3.0.ipv8.test.test_taskmanager Classes ------- .. autoapisummary:: 3.0.ipv8.test.test_taskmanager.TestTaskManager Module Contents --------------- .. py:class:: TestTaskManager Bases: :py:obj:`3.0.ipv8.test.base.TestBase` Tests related to the task manager. .. py:method:: setUp() -> None Create a task manager. .. py:method:: tearDown() -> None :async: Shut down the task manager. .. py:method:: count() -> None A function used to increment the local counter. .. py:method:: set_counter(value: int) -> None Set the testing counter to a fixed value. .. py:method:: test_call_later() -> None Check that tasks can be sheduled for the future. .. py:method:: test_call_later_and_cancel() -> None Check that scheduled tasks can be canceled. .. py:method:: test_replace_with_duplicate() -> None :async: Check that a scheduled task can be overwritten by name, cancelling the previous task. .. py:method:: test_replace_without_duplicate() -> None :async: Check that replacing without a running task with the same name simply registers the task. .. py:method:: test_replace_with_error() -> None :async: Check that a task with faulty arguments raises a TypeError when replaced. .. py:method:: test_looping_call() -> None Check that repeating calls can be registered. .. py:method:: test_looping_call_and_cancel() -> None Check that repeating calls can be cancelled. .. py:method:: test_delayed_looping_call_requires_coroutine() -> None Check that delayed calls cannot be futures. .. py:method:: test_delayed_looping_call_register_and_cancel_pre_delay() -> None Check that a delayed repeating call can be cancelled. .. py:method:: test_delayed_looping_call_register_wait_and_cancel() -> None :async: Check if interval tasks are actually properly called. .. py:method:: test_raise_on_duplicate_task_name() -> None Check that a normal register task cannot be used as a replace task. .. py:method:: test_duplicate_anon_task() -> None Tests that anonymous tasks allow the same base name to be reused. .. py:method:: test_shutdown() -> None :async: Check if the TaskManager does not allow new tasks after shutdown(). .. py:method:: test_cleanup() -> None :async: Check if the tasks are cleaned up after the cleanup frequency has been met. .. py:method:: test_cleanup_remaining() -> None :async: Check if tasks which have yet to complete are not cleaned. .. py:method:: test_task_with_exception() -> None :async: Check if tasks forward their exceptions properly. .. py:method:: test_task_with_exception_ignore() -> None :async: Check that ignored exceptions do not end up in the main/generic exception handler. Note that they are still locally raised! .. py:method:: test_task_decorator_coro() -> None :async: Check that the task decorator allows functions to be wrapped. .. py:method:: test_task_decorator_no_coro() -> None Check if an attempt to taskify a non-async function raises a TypeError. .. py:method:: test_register_task_with_future() -> None :async: Check if registering a Future works. .. py:method:: test_cancel_future() -> None :async: Check if cancelling a Future works. .. py:method:: test_register_executor_task() -> None :async: Check if registering an executor task works. .. py:method:: test_register_executor_task_anon() -> None :async: Check if registering anonymous executor tasks work. .. py:method:: test_register_shutdown_task() -> None :async: Check if registering a task on TaskManager shutdown works. .. py:method:: test_register_shutdown_function() -> None :async: Check if registering a plain function on TaskManager shutdown works. .. py:method:: test_get_task_existing_pending() -> None :async: Check if an existing pending task can be retrieved. .. py:method:: test_get_task_existing_finished() -> None :async: Check if an existing finished task can be retrieved. .. py:method:: test_get_task_non_existent() -> None Check if retrieving an unknown task returns None. .. py:method:: test_get_anon_tasks_existing_pending() -> None :async: Check if existing pending anonymous tasks can be retrieved. .. py:method:: test_get_anon_tasks_existing_finished() -> None :async: Check if existing finished anonymous tasks can be retrieved. .. py:method:: test_get_anon_tasks_non_existent() -> None Check if retrieving anonymous tasks with an unknown base name returns an empty list.