Skip to content

Commit e1507a0

Browse files
committed
AsyncAPI 3.0.0 Confluent publisher tests
1 parent 9805296 commit e1507a0

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.confluent import KafkaBroker
3+
from tests.asyncapi.base.v3_0_0.publisher import PublisherTestcase
4+
5+
6+
class TestArguments(PublisherTestcase):
7+
broker_class = KafkaBroker
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+
"kafka": {"bindingVersion": "0.4.0", "topic": "test"}
20+
}

0 commit comments

Comments
 (0)