Skip to content

Commit ef3f6e5

Browse files
committed
AsyncAPI 3.0.0 Nats publisher tests
1 parent e1507a0 commit ef3f6e5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from faststream.asyncapi.generate import get_app_schema
2+
from faststream.nats import NatsBroker
3+
from tests.asyncapi.base.v3_0_0.publisher import PublisherTestcase
4+
5+
6+
class TestArguments(PublisherTestcase):
7+
broker_class = NatsBroker
8+
9+
def test_publisher_bindings(self):
10+
broker = self.broker_class()
11+
12+
@broker.publisher("test")
13+
async def handle(msg): ...
14+
15+
schema = get_app_schema(self.build_app(broker)).to_jsonable()
16+
key = tuple(schema["channels"].keys())[0] # noqa: RUF015
17+
18+
assert schema["channels"][key]["bindings"] == {
19+
"nats": {"bindingVersion": "custom", "subject": "test"}
20+
}, schema["channels"][key]["bindings"]

0 commit comments

Comments
 (0)