Skip to main content

Unit Tests for CODITECT Task Queue Manager

Part of Track H.2: Inter-Agent Communication Infrastructure

Tests cover:

  • Task data model serialization/deserialization
  • TaskQueueConfig from various sources
  • LocalTaskQueue functionality
  • TaskQueueManager operations
  • Priority queue ordering
  • Dependency resolution and unblocking
  • Deadlock detection
  • Retry logic

Run tests: cd scripts/core python -m pytest test_task_queue_manager.py -v

# Or directly
python test_task_queue_manager.py

Author: CODITECT Framework Created: January 8, 2026 Version: 1.0.0

File: test_task_queue_manager.py

Classes

TestTask

Test Task dataclass.

TestTaskStatus

Test TaskStatus enum.

TestTaskPriority

Test TaskPriority enum.

TestTaskQueueConfig

Test TaskQueueConfig dataclass.

TestLocalTaskQueue

Test LocalTaskQueue for development mode.

TestTaskQueueManagerLocalMode

Test TaskQueueManager in local fallback mode (no Redis).

TestCreateTaskHelper

Test create_task helper function.

Functions

run_tests()

Run all tests and return results.

test_create_default_task()

Test creating a task with default values.

test_create_custom_task()

Test creating a task with custom values.

test_to_dict()

Test converting task to dictionary.

test_to_json()

Test converting task to JSON string.

test_from_dict()

Test creating task from dictionary.

test_from_json()

Test creating task from JSON string.

test_round_trip_serialization()

Test that task survives JSON round-trip.

test_is_expired_false()

Test that new task is not expired.

test_can_retry_true()

Test that task with retries remaining can retry.

test_can_retry_false()

Test that task with no retries remaining cannot retry.

test_status_values()

Test all status values.

test_priority_order()

Test priority values are ordered correctly.

test_priority_values()

Test specific priority values.

test_default_config()

Test default configuration values.

Usage

python test_task_queue_manager.py