Files
moloapp/tests/example/webdav/files_test.cpp
T
retoor 3c4334cec9 feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security,
data, app, realtime, supervisor, clients, CLI, example plus
enterprise tenancy, audit, operability, governance,
supplychain. Postgres via docker compose for tests.
2026-10-23 18:20:04 +02:00

24 lines
967 B
C++

// Route: /webdav/files/ (PROPFIND, GET, PUT, DELETE)
#include "support/Assert.hpp"
using namespace molo::example::test;
using molo::example::fw::Method;
int main() {
Fixture f;
auto list = f.client->request(Method::Propfind, "/webdav/files/");
check(list.status == 207, "propfind is 207");
check(contains(list.body, "welcome.txt"), "seed file listed");
auto put = f.client->request(Method::Put, "/webdav/files/new.txt",
"new-data", {{"Content-Type", "text/plain"}});
check(put.status == 201, "put is 201");
auto get = f.client->request(Method::Get, "/webdav/files/new.txt");
check(contains(get.body, "new-data"), "round trip works");
auto del =
f.client->request(Method::Delete, "/webdav/files/new.txt");
check(del.status == 200, "delete is 200");
auto gone = f.client->request(Method::Get, "/webdav/files/new.txt");
check(gone.status == 404, "deleted file is 404");
return finish("webdav/files");
}