Skip to content

Commit

Permalink
AsyncAPI 3.0.0 Nats arguments tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KrySeyt committed Jul 31, 2024
1 parent 0d5426e commit a2300a2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/asyncapi/nats/v3_0_0/test_arguments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from faststream.asyncapi.generate import get_app_schema
from faststream.nats import NatsBroker
from tests.asyncapi.base.v3_0_0.arguments import ArgumentsTestcase


class TestArguments(ArgumentsTestcase):
broker_class = NatsBroker

def test_subscriber_bindings(self):
broker = self.broker_class()

@broker.subscriber("test")
async def handle(msg): ...

schema = get_app_schema(self.build_app(broker)).to_jsonable()
key = tuple(schema["channels"].keys())[0] # noqa: RUF015

assert schema["channels"][key]["bindings"] == {
"nats": {"bindingVersion": "custom", "subject": "test"}
}
Empty file.

0 comments on commit a2300a2

Please sign in to comment.