Coverage for faststream / redis / schemas / proto.py: 44%
10 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-08 01:48 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-08 01:48 +0000
1from faststream.exceptions import SetupError
3from .list_sub import ListSub
4from .pub_sub import PubSub
5from .stream_sub import StreamSub
8def validate_options(
9 *,
10 channel: PubSub | str | None,
11 list: ListSub | str | None,
12 stream: StreamSub | str | None,
13) -> None:
14 if all((channel, list)): 14 ↛ 15line 14 didn't jump to line 15 because the condition on line 14 was never true
15 msg = "You can't use `PubSub` and `ListSub` both"
16 raise SetupError(msg)
17 if all((channel, stream)): 17 ↛ 18line 17 didn't jump to line 18 because the condition on line 17 was never true
18 msg = "You can't use `PubSub` and `StreamSub` both"
19 raise SetupError(msg)
20 if all((list, stream)): 20 ↛ 21line 20 didn't jump to line 21 because the condition on line 20 was never true
21 msg = "You can't use `ListSub` and `StreamSub` both"
22 raise SetupError(msg)