Skip to content

Commit db17162

Browse files
committed
feat(python-bindings): steaming tests
Signed-off-by: Mauro Sardara <[email protected]>
1 parent 1c55506 commit db17162

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

data-plane/python-bindings/tests/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import agp_bindings
33
import asyncio
44

5+
56
@pytest_asyncio.fixture(scope="function")
67
async def server(request):
78
# create new server

data-plane/python-bindings/tests/test_pubsub.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ async def background_task(index):
8080
while True:
8181
try:
8282
# receive message from session
83-
recv_session, msg_rcv = await participant.receive(session=session_info.id)
83+
recv_session, msg_rcv = await participant.receive(
84+
session=session_info.id
85+
)
8486

8587
# increase the count
8688
local_count += 1
@@ -103,9 +105,7 @@ async def background_task(index):
103105
# reply to the session and call out the next participant
104106
next_participant = (index + 1) % participants_count
105107
next_participant_name = f"participant-{next_participant}"
106-
print(
107-
f"{name} -> Calling out {next_participant_name}..."
108-
)
108+
print(f"{name} -> Calling out {next_participant_name}...")
109109
await participant.publish(
110110
recv_session,
111111
f"{message} - {next_participant_name}".encode(),
@@ -114,7 +114,9 @@ async def background_task(index):
114114
chat,
115115
)
116116
else:
117-
print(f"{name} -> Receving message: {msg_rcv.decode()} - not for me. Local count: {local_count}")
117+
print(
118+
f"{name} -> Receving message: {msg_rcv.decode()} - not for me. Local count: {local_count}"
119+
)
118120

119121
# If we received as many messages as the number of participants, we can exit
120122
if local_count >= (participants_count - 1):
@@ -134,4 +136,3 @@ async def background_task(index):
134136
# Wait for the task to complete
135137
for task in participants:
136138
await task
137-

0 commit comments

Comments
 (0)