From 94701c170c9289ff0b49217e0cbc6f75ff8c1e4d Mon Sep 17 00:00:00 2001 From: Quentin Rendu Date: Sat, 21 Oct 2023 11:44:50 +0200 Subject: [PATCH] Add test for Round 5 of simple swiss --- api-webapp/src/test/kotlin/BasicTests.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/api-webapp/src/test/kotlin/BasicTests.kt b/api-webapp/src/test/kotlin/BasicTests.kt index b9a3014..87ed50d 100644 --- a/api-webapp/src/test/kotlin/BasicTests.kt +++ b/api-webapp/src/test/kotlin/BasicTests.kt @@ -406,6 +406,21 @@ class BasicTests: TestBase() { } logger.info("Results succesfully entered for round 4") + // *** Test Round 5 *** + games_np = TestAPI.post("/api/tour/$id_np/pair/5", Json.Array("all")).asArray() + logger.info("games for round 5: {}", games_np.toString()) + + assertTrue(compare_weights("weights.txt", "opengotha/simpleswiss_weights_R5.txt"), "Not matching opengotha weights for round 4") + assertTrue(compare_games(games_np, Json.parse(pairings_R5.toString())!!.asArray()), "pairings for round 5 differ") + //assertEquals(pairings_R4, games_np.toString(), "pairings for round 3 differ") + logger.info("Pairings for round 5 match OpenGotha") + + for (game_id in 907..922) { + resp_np = TestAPI.put("/api/tour/$id_np/res/5", Json.parse("""{"id":$game_id,"result":"b"}""")).asObject() + assertTrue(resp_np.getBoolean("success") == true, "expecting success") + } + logger.info("Results succesfully entered for round 5") + } } \ No newline at end of file