From 95d95836ab2e988d017a33319eb83687b4e06ad4 Mon Sep 17 00:00:00 2001 From: Vladimir Kibisov Date: Wed, 31 Jul 2024 23:12:37 +0300 Subject: [PATCH] AsyncAPI 3.0.0 Confluent arguments tests --- .../confluent/v3_0_0/test_arguments.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/asyncapi/confluent/v3_0_0/test_arguments.py diff --git a/tests/asyncapi/confluent/v3_0_0/test_arguments.py b/tests/asyncapi/confluent/v3_0_0/test_arguments.py new file mode 100644 index 0000000000..821d8df6be --- /dev/null +++ b/tests/asyncapi/confluent/v3_0_0/test_arguments.py @@ -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"} + }