ListBatchPublisher
faststream.redis.publisher.usecase.ListBatchPublisher #
ListBatchPublisher(
config: RedisPublisherConfig,
specification: PublisherSpecification[Any, Any],
*,
list: ListSub,
)
Bases: ListPublisher
Source code in faststream/redis/publisher/usecase.py
mock property #
The mock recording the endpoint's calls, available under a test broker.
publish async #
publish(
*messages: SendableMessage,
list: str | None = None,
correlation_id: str | None = None,
reply_to: str = "",
headers: dict[str, Any] | None = None,
pipeline: Optional[Pipeline[bytes]] = None,
) -> int
Source code in faststream/redis/publisher/usecase.py
request async #
request(
message: SendableMessage = None,
list: str | None = None,
*,
correlation_id: str | None = None,
headers: dict[str, Any] | None = None,
timeout: float | None = 30.0,
) -> RedisChannelMessage
Source code in faststream/redis/publisher/usecase.py
assert_called_once_with async #
assert_called_once_with(
body: Any = EMPTY,
/,
*,
headers: Any = EMPTY,
correlation_id: Any = EMPTY,
reply_to: Any = EMPTY,
content_type: Any = EMPTY,
path: Any = EMPTY,
context: Mapping[str, Any] = EMPTY,
) -> None
Assert the endpoint was called once, with the message described here.
| PARAMETER | DESCRIPTION |
|---|---|
body | The body as a dict, a model or a matcher; it goes through the codec. TYPE: |
headers | Headers the message must carry; the rest may carry more. TYPE: |
correlation_id | The exact correlation id. TYPE: |
reply_to | The exact reply-to destination. TYPE: |
content_type | The exact content type. TYPE: |
path | The exact path parameters the subject template matched. TYPE: |
context | Context paths, as given to TYPE: |
Source code in faststream/_internal/testing/calls.py
assert_called_with async #
assert_called_with(
body: Any = EMPTY,
/,
*,
headers: Any = EMPTY,
correlation_id: Any = EMPTY,
reply_to: Any = EMPTY,
content_type: Any = EMPTY,
path: Any = EMPTY,
context: Mapping[str, Any] = EMPTY,
) -> None
Assert the last message the endpoint saw is the one described here.
| PARAMETER | DESCRIPTION |
|---|---|
body | The body as a dict, a model or a matcher; it goes through the codec. TYPE: |
headers | Headers the message must carry; the rest may carry more. TYPE: |
correlation_id | The exact correlation id. TYPE: |
reply_to | The exact reply-to destination. TYPE: |
content_type | The exact content type. TYPE: |
path | The exact path parameters the subject template matched. TYPE: |
context | Context paths, as given to TYPE: |
Source code in faststream/_internal/testing/calls.py
assert_any_call async #
assert_any_call(
body: Any = EMPTY,
/,
*,
headers: Any = EMPTY,
correlation_id: Any = EMPTY,
reply_to: Any = EMPTY,
content_type: Any = EMPTY,
path: Any = EMPTY,
context: Mapping[str, Any] = EMPTY,
) -> None
Assert one of the messages the endpoint saw is the one described here.
| PARAMETER | DESCRIPTION |
|---|---|
body | The body as a dict, a model or a matcher; it goes through the codec. TYPE: |
headers | Headers the message must carry; the rest may carry more. TYPE: |
correlation_id | The exact correlation id. TYPE: |
reply_to | The exact reply-to destination. TYPE: |
content_type | The exact content type. TYPE: |
path | The exact path parameters the subject template matched. TYPE: |
context | Context paths, as given to TYPE: |
Source code in faststream/_internal/testing/calls.py
start async #
Source code in faststream/redis/publisher/usecase.py
set_test #
Turn publisher to testing mode, sharing recorder when one is given.
Source code in faststream/_internal/endpoint/publisher/usecase.py
reset_test #
Turn off publisher's testing mode.
Source code in faststream/_internal/endpoint/publisher/usecase.py
schema #
schema() -> dict[str, PublisherSpec]