Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
otariidae committed Oct 24, 2022
1 parent 0a7900e commit 4f3afa8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/multicaster/test_one_to_multiple_cast_skyway.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ async def test_connect_sender_with_invalid_sender_token(self) -> None:
)
)
await asyncio.sleep(WAIT_STATE_CHANGE_SEC)
self.assertIn(DUMMY_ROOM_ID, rooms)
self.assertIsNone(rooms[DUMMY_ROOM_ID]["sender_socket"])
self.assertEqual(len(rooms[DUMMY_ROOM_ID]["connections"]), 0)
self.assertEqual(rooms[DUMMY_ROOM_ID]["connect_num"], 0)
self.assertNotIn(DUMMY_ROOM_ID, rooms)
await asyncio.sleep(WAIT_STATE_CHANGE_SEC)
self.assertNotIn(DUMMY_ROOM_ID, rooms)

Expand All @@ -81,10 +78,14 @@ async def test_connect_sender_with_valid_sender_token(self) -> None:
await asyncio.sleep(WAIT_STATE_CHANGE_SEC)
self.assertIn(DUMMY_ROOM_ID, rooms)
self.assertIsNotNone(rooms[DUMMY_ROOM_ID]["sender_socket"])
self.assertEqual(len(rooms[DUMMY_ROOM_ID]["connections"]), 1)
self.assertEqual(rooms[DUMMY_ROOM_ID]["connect_num"], 0)
self.assertEqual(
rooms[DUMMY_ROOM_ID]["skyway_room_id"], DUMMY_SKYWAY_ROOM_ID
)
self.assertEqual(rooms[DUMMY_ROOM_ID]["peer_id"], DUMMY_PEER_ID)
await asyncio.sleep(WAIT_STATE_CHANGE_SEC)
self.assertNotIn(DUMMY_ROOM_ID, rooms)

@patch("one_to_multiple_cast_skyway.SENDER_TOKEN", DUMMY_SENDER_TOKEN)
async def test_connect_receiver(self) -> None:
Expand Down

0 comments on commit 4f3afa8

Please sign in to comment.