Skip to content

Commit

Permalink
AsyncAPI 3.0.0 Confluent arguments tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KrySeyt committed Jul 31, 2024
1 parent 8de3846 commit 95d9583
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/asyncapi/confluent/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.confluent import KafkaBroker
from tests.asyncapi.base.v3_0_0.arguments import ArgumentsTestcase


class TestArguments(ArgumentsTestcase):
broker_class = KafkaBroker

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"] == {
"kafka": {"bindingVersion": "0.4.0", "topic": "test"}
}

0 comments on commit 95d9583

Please sign in to comment.