Force pairings using API.put for round 1 of test 9

This commit is contained in:
Quentin Rendu
2023-11-29 10:02:38 +01:00
parent 6fdceab222
commit 64ec62ae21

View File

@@ -261,13 +261,15 @@ class PairingTests: TestBase() {
//games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array(playersList.filter{it != byePlayerList[round-1]})).asArray() //games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array(playersList.filter{it != byePlayerList[round-1]})).asArray()
if (round in forcedPairingList){ if (round in forcedPairingList){
// games must be created and then modified by PUT
games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array("all")).asArray()
forcedPairing = mutableListOf<Json>() forcedPairing = mutableListOf<Json>()
forcedGames = Json.parse(pairingsR1)!!.asArray() forcedGames = Json.parse(pairingsR1)!!.asArray()
for (j in 0..forcedGames.size-1) { for (j in 0..forcedGames.size-1) {
game = forcedGames.getJson(j)!!.asObject() game = forcedGames.getJson(j)!!.asObject()
forcedPairing.add(TestAPI.post("/api/tour/$id/pair/$round", Json.Array(listOf(game["w"],game["b"]))).asArray().getJson(0)!!) TestAPI.put("/api/tour/$id/pair/$round", game)
} }
games = Json.Array(forcedPairing) games = TestAPI.get("/api/tour/$id/res/$round").asArray()
} }
else { else {
games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array("all")).asArray() games = TestAPI.post("/api/tour/$id/pair/$round", Json.Array("all")).asArray()