Commit a5e4dad 1 parent 528cf42 commit a5e4dad Copy full SHA for a5e4dad
File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,21 @@ async def test_redis_stream():
71
71
assert event .message == "hello"
72
72
73
73
74
+ @pytest .mark .asyncio
75
+ async def test_redis_resubscription ():
76
+ async with Broadcast ("redis://localhost:6379" ) as broadcast :
77
+ async with broadcast .subscribe ("chatroom" ) as subscriber :
78
+ await broadcast .publish ("chatroom" , "hello" )
79
+ event = await subscriber .get ()
80
+ assert event .channel == "chatroom"
81
+
82
+ await asyncio .sleep (0 )
83
+ async with broadcast .subscribe ("chatroom2" ) as subscriber :
84
+ await broadcast .publish ("chatroom2" , "hello" )
85
+ event = await subscriber .get ()
86
+ assert event .channel == "chatroom2"
87
+
88
+
74
89
@pytest .mark .asyncio
75
90
async def test_postgres ():
76
91
async with Broadcast ("postgres://postgres:postgres@localhost:5432/broadcaster" ) as broadcast :
You can’t perform that action at this time.
0 commit comments