feat: complete human-vs-ESP32 gameplay and cumulative statistics
This commit is contained in:
@@ -140,6 +140,11 @@ static void test_sessions_commands_and_state(void) {
|
||||
assert(response.status == 200U && strstr(response.body, "\"viewer\":\"player1\"") != NULL);
|
||||
response = call(&api, HTTP_API_ROUTE_STATE, HTTP_API_GET, NULL, "bad");
|
||||
expect_code(&response, 401U, "UNAUTHORIZED");
|
||||
response = call(&api, HTTP_API_ROUTE_STATISTICS, HTTP_API_GET, NULL, player_1_token);
|
||||
assert(response.status == 200U && strstr(response.body, "\"viewer\":\"player1\"") != NULL &&
|
||||
strstr(response.body, "\"match\":[[") != NULL && strstr(response.body, "\"cumulative\":[[") != NULL);
|
||||
response = call(&api, HTTP_API_ROUTE_STATISTICS, HTTP_API_GET, NULL, "bad");
|
||||
expect_code(&response, 401U, "UNAUTHORIZED");
|
||||
|
||||
snprintf(command, sizeof(command), "{\"token\":\"%s\",\"gameId\":1,\"x\":10,\"y\":0}", player_1_token);
|
||||
response = call(&api, HTTP_API_ROUTE_SHOT, HTTP_API_POST, command, NULL);
|
||||
|
||||
Reference in New Issue
Block a user