mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
clean up standalone tests
This commit is contained in:
@@ -379,7 +379,6 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
|||||||
request.method(HTTP_GET);
|
request.method(HTTP_GET);
|
||||||
request.url("/api/custom");
|
request.url("/api/custom");
|
||||||
EMSESP::webAPIService.webAPIService(&request);
|
EMSESP::webAPIService.webAPIService(&request);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
ok = true;
|
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");
|
// request.url("/api/custom/test_seltemp/val");
|
||||||
// EMSESP::webAPIService.webAPIService(&request);
|
// EMSESP::webAPIService.webAPIService(&request);
|
||||||
|
|
||||||
// // set a custom value
|
// set a custom value
|
||||||
// request.method(HTTP_POST);
|
// request.method(HTTP_POST);
|
||||||
// char data0[] = "{\"value\":\"99\"}";
|
// char data0[] = "{\"value\":\"99\"}";
|
||||||
// deserializeJson(doc, data0);
|
// 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");
|
// request.url("/api/custom/test_seltemp");
|
||||||
// EMSESP::webAPIService.webAPIService(&request, json);
|
// 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.method(HTTP_POST);
|
||||||
request.url("/api/system/message");
|
request.url("/api/system/message");
|
||||||
|
|
||||||
// output: hello world
|
// output: hello world!
|
||||||
EMSESP::webAPIService.webAPIService(&request, "'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
|
// output: locale is en
|
||||||
EMSESP::webAPIService.webAPIService(&request, "'locale is 'system/settings/locale");
|
EMSESP::webAPIService.webAPIService(&request, "'locale is 'system/settings/locale");
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ namespace emsesp {
|
|||||||
// #define EMSESP_DEBUG_DEFAULT "ls"
|
// #define EMSESP_DEBUG_DEFAULT "ls"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "upload"
|
// #define EMSESP_DEBUG_DEFAULT "upload"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "hpmode"
|
// #define EMSESP_DEBUG_DEFAULT "hpmode"
|
||||||
#define EMSESP_DEBUG_DEFAULT "shuntingyard"
|
|
||||||
|
|
||||||
#ifndef EMSESP_DEBUG_DEFAULT
|
#ifndef EMSESP_DEBUG_DEFAULT
|
||||||
#define EMSESP_DEBUG_DEFAULT "general"
|
#define EMSESP_DEBUG_DEFAULT "general"
|
||||||
|
|||||||
Reference in New Issue
Block a user