Add test for Round 6 of simple swiss
This commit is contained in:
@@ -416,7 +416,7 @@ class BasicTests: TestBase() {
|
||||
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_weights("weights.txt", "opengotha/simpleswiss_weights_R5.txt"), "Not matching opengotha weights for round 5")
|
||||
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")
|
||||
@@ -428,6 +428,21 @@ class BasicTests: TestBase() {
|
||||
}
|
||||
logger.info("Results succesfully entered for round 5")
|
||||
|
||||
// *** Test Round 6 ***
|
||||
games_np = TestAPI.post("/api/tour/$id_np/pair/6", Json.Array("all")).asArray()
|
||||
logger.info("games for round 6: {}", games_np.toString())
|
||||
|
||||
assertTrue(compare_weights("weights.txt", "opengotha/simpleswiss_weights_R6.txt"), "Not matching opengotha weights for round 6")
|
||||
assertTrue(compare_games(games_np, Json.parse(pairings_R6.toString())!!.asArray()), "pairings for round 6 differ")
|
||||
logger.info("Pairings for round 6 match OpenGotha")
|
||||
|
||||
firstGameID = (games_np.getJson(0)!!.asObject()["id"] as Long?)!!.toInt()
|
||||
for (game_id in firstGameID..firstGameID+15) {
|
||||
resp_np = TestAPI.put("/api/tour/$id_np/res/6", Json.parse("""{"id":$game_id,"result":"b"}""")).asObject()
|
||||
assertTrue(resp_np.getBoolean("success") == true, "expecting success")
|
||||
}
|
||||
logger.info("Results succesfully entered for round 6")
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user