add API to test suite

This commit is contained in:
proddy
2021-06-10 23:10:26 +02:00
parent fad1b09e19
commit 50540f1f82
5 changed files with 34 additions and 7 deletions

View File

@@ -931,8 +931,17 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
if (command == "api") {
shell.printfln(F("Testing RESTful API..."));
// TODO add API
// AsyncWebServerRequest * request;
Mqtt::ha_enabled(false);
run_test("general");
DynamicJsonDocument doc(EMSESP_JSON_SIZE_XXLARGE_DYN);
JsonObject json = doc.to<JsonObject>();
AsyncWebServerRequest request;
request.method(HTTP_GET);
request.url("/api/thermostat/seltemp");
EMSESP::webAPIService.webAPIService_get(&request);
request.url("/api/boiler/syspress");
EMSESP::webAPIService.webAPIService_get(&request);
}
}