LogicPublisher
faststream.redis.publisher.usecase.LogicPublisher #
LogicPublisher(
config: RedisPublisherConfig,
specification: PublisherSpecification[Any, Any],
)
Bases: PublisherUsecase
A class to represent a Redis publisher.
Source code in faststream/redis/publisher/usecase.py
mock property #
The mock recording the endpoint's calls, available under a test broker.
start async #
Source code in faststream/redis/publisher/usecase.py
subscriber_property abstractmethod #
publish abstractmethod async #
Public method to publish a message.
Should be called by user only broker.publisher(...).publish(...).
Source code in faststream/_internal/endpoint/publisher/proto.py
request abstractmethod async #
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
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]