From 08fe6529f70662ba6d3d4d51cc076797ef2f133f Mon Sep 17 00:00:00 2001 From: Vladimir Kibisov Date: Fri, 2 Aug 2024 21:53:21 +0300 Subject: [PATCH] Redis asyncapi fastapi tests --- tests/asyncapi/redis/v3_0_0/test_fastapi.py | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/asyncapi/redis/v3_0_0/test_fastapi.py b/tests/asyncapi/redis/v3_0_0/test_fastapi.py index e69de29bb2..2140570c27 100644 --- a/tests/asyncapi/redis/v3_0_0/test_fastapi.py +++ b/tests/asyncapi/redis/v3_0_0/test_fastapi.py @@ -0,0 +1,24 @@ +from typing import Type + +from faststream.asyncapi.version import AsyncAPIVersion +from faststream.redis import TestRedisBroker +from faststream.redis.fastapi import RedisRouter +from tests.asyncapi.base.v3_0_0.arguments import FastAPICompatible +from tests.asyncapi.base.v3_0_0.fastapi import FastAPITestCase +from tests.asyncapi.base.v3_0_0.publisher import PublisherTestcase + + +class TestRouterArguments(FastAPITestCase, FastAPICompatible): + broker_factory = staticmethod(lambda: RedisRouter(asyncapi_version=AsyncAPIVersion.v3_0)) + router_factory = RedisRouter + broker_wrapper = staticmethod(TestRedisBroker) + + def build_app(self, router): + return router + + +class TestRouterPublisher(PublisherTestcase): + broker_factory = staticmethod(lambda: RedisRouter(asyncapi_version=AsyncAPIVersion.v3_0)) + + def build_app(self, router): + return router