clean up standalone tests

This commit is contained in:
proddy
2025-10-05 15:32:38 +02:00
parent 48a1bd0fe6
commit 0c6aef5b60
2 changed files with 25 additions and 5 deletions

View File

@@ -379,7 +379,6 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
request.method(HTTP_GET);
request.url("/api/custom");
EMSESP::webAPIService.webAPIService(&request);
#endif
ok = true;
}
@@ -1090,7 +1089,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
// request.url("/api/custom/test_seltemp/val");
// EMSESP::webAPIService.webAPIService(&request);
// // set a custom value
// set a custom value
// request.method(HTTP_POST);
// char data0[] = "{\"value\":\"99\"}";
// deserializeJson(doc, data0);
@@ -1098,11 +1097,33 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
// request.url("/api/custom/test_seltemp");
// EMSESP::webAPIService.webAPIService(&request, json);
// Note, works in test not in production - causes a crash!
// request.method(HTTP_POST);
// char data1[] = "{\"value\":\"system/settings/locale\"}";
// deserializeJson(doc, data1);
// JsonVariant json = doc.as<JsonVariant>();
// request.url("/api/system/message");
// EMSESP::webAPIService.webAPIService(&request, json);
request.method(HTTP_POST);
char data1[] = "{\"value\":\"custom/test_custom\"}";
deserializeJson(doc, data1);
JsonVariant json = doc.as<JsonVariant>();
request.url("/api/system/message");
EMSESP::webAPIService.webAPIService(&request, json);
request.method(HTTP_POST);
request.url("/api/system/message");
// output: hello world
EMSESP::webAPIService.webAPIService(&request, "'hello world'");
// output: hello world!
EMSESP::webAPIService.webAPIService(&request, "'hello world!'");
EMSESP::webAPIService.webAPIService(&request, "\"hello world!\"");
// output: helloworld
EMSESP::webAPIService.webAPIService(&request, "hello world");
// output: en
EMSESP::webAPIService.webAPIService(&request, "system/settings/locale");
// output: locale is en
EMSESP::webAPIService.webAPIService(&request, "'locale is 'system/settings/locale");

View File

@@ -62,7 +62,6 @@ namespace emsesp {
// #define EMSESP_DEBUG_DEFAULT "ls"
// #define EMSESP_DEBUG_DEFAULT "upload"
// #define EMSESP_DEBUG_DEFAULT "hpmode"
#define EMSESP_DEBUG_DEFAULT "shuntingyard"
#ifndef EMSESP_DEBUG_DEFAULT
#define EMSESP_DEBUG_DEFAULT "general"