mirror of
https://github.com/langgenius/dify.git
synced 2026-02-13 06:24:44 +08:00
The frontend and backend implementation for the human input node. Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: yyh <92089059+lyzno1@users.noreply.github.com> Co-authored-by: zhsama <torvalds@linux.do>
21 lines
759 B
Python
21 lines
759 B
Python
from configs import dify_config
|
|
from extensions import ext_redis
|
|
from libs.broadcast_channel.redis.channel import BroadcastChannel as RedisBroadcastChannel
|
|
from libs.broadcast_channel.redis.sharded_channel import ShardedRedisBroadcastChannel
|
|
|
|
|
|
def test_get_pubsub_broadcast_channel_defaults_to_pubsub(monkeypatch):
|
|
monkeypatch.setattr(dify_config, "PUBSUB_REDIS_CHANNEL_TYPE", "pubsub")
|
|
|
|
channel = ext_redis.get_pubsub_broadcast_channel()
|
|
|
|
assert isinstance(channel, RedisBroadcastChannel)
|
|
|
|
|
|
def test_get_pubsub_broadcast_channel_sharded(monkeypatch):
|
|
monkeypatch.setattr(dify_config, "PUBSUB_REDIS_CHANNEL_TYPE", "sharded")
|
|
|
|
channel = ext_redis.get_pubsub_broadcast_channel()
|
|
|
|
assert isinstance(channel, ShardedRedisBroadcastChannel)
|