2.12.ipv8.test.test_taskmanager

Module Contents

Classes

class 2.12.ipv8.test.test_taskmanager.TestTaskManager

Bases: 2.12.ipv8.test.base.TestBase

Tests related to the task manager.

setUp() None

Create a task manager.

async tearDown() None

Shut down the task manager.

test_call_later() None

Check that tasks can be sheduled for the future.

test_call_later_and_cancel() None

Check that scheduled tasks can be canceled.

async test_replace_with_duplicate() None

Check that a scheduled task can be overwritten by name, cancelling the previous task.

async test_replace_without_duplicate() None

Check that replacing without a running task with the same name simply registers the task.

async test_replace_with_error() None

Check that a task with faulty arguments raises a ValueError when replaced.

test_looping_call() None

Check that repeating calls can be registered.

test_looping_call_and_cancel() None

Check that repeating calls can be cancelled.

test_delayed_looping_call_requires_coroutine() None

Check that delayed calls cannot be futures.

test_delayed_looping_call_register_and_cancel_pre_delay() None

Check that a delayed repeating call can be cancelled.

async test_delayed_looping_call_register_wait_and_cancel() None

Check if interval tasks are actually properly called.

test_raise_on_duplicate_task_name() None

Check that a normal register task cannot be used as a replace task.

test_duplicate_anon_task() None

Tests that anonymous tasks allow the same base name to be reused.

async test_shutdown() None

Check if the TaskManager does not allow new tasks after shutdown().

async test_cleanup() None

Check if the tasks are cleaned up after the cleanup frequency has been met.

async test_cleanup_remaining() None

Check if tasks which have yet to complete are not cleaned.

async test_task_with_exception() None

Check if tasks forward their exceptions properly.

async test_task_with_exception_ignore() None

Check that ignored exceptions do not end up in the main/generic exception handler.

Note that they are still locally raised!

async test_task_decorator_coro() None

Check that the task decorator allows functions to be wrapped.

test_task_decorator_no_coro() None

Check if an attempt to taskify a non-async function raises a TypeError.

count() None

A function used to increment the local counter.

set_counter(value: int) None

Set the testing counter to a fixed value.