|
1 | | -"""End-to-end translation of the Flutter `BasicsTest` scenario. |
| 1 | +"""End-to-end Test for basic scenarios. |
2 | 2 |
|
3 | 3 | The test exercises connect/disconnect lifecycle, participant |
4 | 4 | visibility, reconnection, and track publish/subscribe between four rooms. |
@@ -47,6 +47,7 @@ def create_token(identity: str, room_name: str) -> str: |
47 | 47 | .to_jwt() |
48 | 48 | ) |
49 | 49 |
|
| 50 | + |
50 | 51 | def unique_room_name(base: str) -> str: |
51 | 52 | return f"{base}-{uuid.uuid4().hex[:8]}" |
52 | 53 |
|
@@ -77,9 +78,7 @@ async def _connect(room: rtc.Room, identity: str, room_name: str) -> str: |
77 | 78 |
|
78 | 79 | async def _ensure_all_connected(rooms: list[rtc.Room]) -> None: |
79 | 80 | await _wait_until( |
80 | | - lambda: all( |
81 | | - r.connection_state == rtc.ConnectionState.CONN_CONNECTED for r in rooms |
82 | | - ), |
| 81 | + lambda: all(r.connection_state == rtc.ConnectionState.CONN_CONNECTED for r in rooms), |
83 | 82 | message="not all rooms reached CONN_CONNECTED", |
84 | 83 | ) |
85 | 84 |
|
@@ -123,9 +122,7 @@ async def _await_event(fut: asyncio.Future, timeout: float = WAIT_TIMEOUT) -> No |
123 | 122 | raise AssertionError("timed out waiting for event") from e |
124 | 123 |
|
125 | 124 |
|
126 | | -async def _publish_video( |
127 | | - room: rtc.Room, track_name: str |
128 | | -) -> rtc.LocalTrackPublication: |
| 125 | +async def _publish_video(room: rtc.Room, track_name: str) -> rtc.LocalTrackPublication: |
129 | 126 | source = rtc.VideoSource(320, 240) |
130 | 127 | track = rtc.LocalVideoTrack.create_video_track(track_name, source) |
131 | 128 | options = rtc.TrackPublishOptions(source=rtc.TrackSource.SOURCE_CAMERA) |
|
0 commit comments