Skip to content

Commit

Permalink
improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
otariidae committed Nov 2, 2022
1 parent ce52310 commit de53fe4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions backend/multicaster/test_one_to_multiple_cast_skyway.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +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]["cumulative_activated_connect_num"], 0
)
self.assertNotIn(DUMMY_ROOM_ID, rooms)
await asyncio.sleep(WAIT_STATE_CHANGE_SEC)
self.assertNotIn(DUMMY_ROOM_ID, rooms)

Expand All @@ -83,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]["cumulative_activated_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 de53fe4

Please sign in to comment.