Brings over 215 tests across 15 files covering the new multi-task framework: BaseTask / PipelineTask bus lifecycle, job RPC and job groups, the bus message hierarchy and serializers, TaskBus + AsyncQueueBus + RedisBus + PgmqBus (with direct and isolated backends), TaskRegistry, the BusBridgeProcessor, the WebSocket proxy tasks, the LLMTask deferral logic, and the PipelineRunner spawn-and-attach flow.
36 lines
1011 B
Python
36 lines
1011 B
Python
#
|
|
# Copyright (c) 2026, Daily
|
|
#
|
|
# SPDX-License-Identifier: BSD 2-Clause License
|
|
#
|
|
|
|
"""Tests for ``pipecat.bus.network`` lazy imports."""
|
|
|
|
import unittest
|
|
|
|
import pipecat.bus.network as network
|
|
|
|
|
|
class TestNetworkPackageLazyImports(unittest.TestCase):
|
|
def test_pgmq_bus_lazy_import(self):
|
|
"""``PgmqBus`` is resolved on first attribute access."""
|
|
from pipecat.bus.network.pgmq import PgmqBus as Direct
|
|
|
|
self.assertIs(network.PgmqBus, Direct)
|
|
|
|
def test_redis_bus_lazy_import(self):
|
|
"""``RedisBus`` is resolved on first attribute access."""
|
|
from pipecat.bus.network.redis import RedisBus as Direct
|
|
|
|
self.assertIs(network.RedisBus, Direct)
|
|
|
|
def test_unknown_attribute_raises(self):
|
|
"""Unknown attributes raise a clear ``AttributeError``."""
|
|
with self.assertRaises(AttributeError) as ctx:
|
|
network.NotARealBus # noqa: B018
|
|
self.assertIn("NotARealBus", str(ctx.exception))
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|