Prepare v0.6.7-alpha discovery release
This commit is contained in:
parent
ef30369865
commit
54937fad4b
7 changed files with 75 additions and 12 deletions
|
|
@ -19,7 +19,7 @@ VALID_ROOM = {
|
|||
"port": 7777,
|
||||
"current_players": 1,
|
||||
"max_players": 8,
|
||||
"game_version": "0.6.4-alpha",
|
||||
"game_version": "0.6.7-alpha",
|
||||
"protocol_version": 3,
|
||||
}
|
||||
|
||||
|
|
@ -91,6 +91,19 @@ class DiscoveryHTTPTests(unittest.TestCase):
|
|||
listed_rooms = listing["rooms"]
|
||||
self.assertTrue(any(candidate["room_id"] == room_id for candidate in listed_rooms))
|
||||
|
||||
status, updated = self.request(
|
||||
"PUT",
|
||||
f"/v1/rooms/{room_id}",
|
||||
dict(VALID_ROOM, game_version="0.6.6-alpha"),
|
||||
str(token),
|
||||
)
|
||||
self.assertEqual(status, 409)
|
||||
assert updated is not None
|
||||
self.assertEqual(updated["error"]["code"], "game_version_mismatch")
|
||||
self.assertEqual(
|
||||
updated["error"]["required_game_version"], "0.6.7-alpha"
|
||||
)
|
||||
|
||||
status, updated = self.request(
|
||||
"PUT",
|
||||
f"/v1/rooms/{room_id}",
|
||||
|
|
@ -110,6 +123,20 @@ class DiscoveryHTTPTests(unittest.TestCase):
|
|||
assert body is not None
|
||||
self.assertEqual(body["error"]["code"], "invalid_room")
|
||||
|
||||
def test_outdated_game_cannot_list_a_room(self) -> None:
|
||||
status, body = self.request(
|
||||
"POST",
|
||||
"/v1/rooms",
|
||||
dict(VALID_ROOM, game_version="0.6.6-alpha"),
|
||||
)
|
||||
self.assertEqual(status, 409)
|
||||
assert body is not None
|
||||
error = body["error"]
|
||||
assert isinstance(error, dict)
|
||||
self.assertEqual(error["code"], "game_version_mismatch")
|
||||
self.assertEqual(error["required_game_version"], "0.6.7-alpha")
|
||||
self.assertIn("will not be listed", str(error["message"]))
|
||||
|
||||
def test_empty_dedicated_room_can_be_listed(self) -> None:
|
||||
status, created = self.request(
|
||||
"POST", "/v1/rooms", dict(VALID_ROOM, current_players=0)
|
||||
|
|
@ -173,7 +200,7 @@ class DiscoveryHTTPTests(unittest.TestCase):
|
|||
self.assertEqual(status, 200)
|
||||
assert body is not None
|
||||
self.assertEqual(body["status"], "ok")
|
||||
self.assertEqual(body["version"], "0.2.0")
|
||||
self.assertEqual(body["version"], "0.6.7-alpha")
|
||||
self.assertEqual(body["build_revision"], "test-build")
|
||||
|
||||
def test_udp_rendezvous_does_not_spawn_per_packet_threads(self) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue