Support empty dedicated room listings

This commit is contained in:
Alexander Sellite 2026-08-10 13:56:03 -04:00
parent b5b3cc0211
commit 6a7c7a676d
6 changed files with 28 additions and 4 deletions

View file

@ -49,6 +49,12 @@ class RoomRegistryTests(unittest.TestCase):
self.registry.delete(room.room_id, token)
self.assertEqual(self.registry.list_rooms(), [])
def test_empty_dedicated_room_is_valid(self) -> None:
room, _token = self.registry.create(
"203.0.113.10", dict(VALID_ROOM, current_players=0)
)
self.assertEqual(room.current_players, 0)
def test_expired_room_is_removed(self) -> None:
room, token = self.registry.create("203.0.113.10", VALID_ROOM)
self.clock.now += 30.0