From 2e04b2c23c66a42372d0ecaea2b0f4b2c7b7c7e5 Mon Sep 17 00:00:00 2001 From: Vincent Douillet Date: Tue, 24 Dec 2024 11:52:50 +0100 Subject: delete files --- test.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'test.c') diff --git a/test.c b/test.c index fe1703a..802afc5 100644 --- a/test.c +++ b/test.c @@ -2,6 +2,7 @@ #include #include "browse.h" +#include "delete.h" #include "http.h" #include "upload.h" #include "url.h" @@ -90,6 +91,42 @@ test_upload_post() return 0; } +static char * +test_delete_get() +{ + struct kreq r; + struct http_ret ret; + + r = (struct kreq) { + .pname = "/vault", + .path = "a", + .suffix = "txt", + .method = KMETHOD_GET, + }; + ret = del(&r); + + mu_assert("error, GET delete failed!", ret.code <= KHTTP_400); + return 0; +} + +static char * +test_delete_post() +{ + struct kreq r; + struct http_ret ret; + + r = (struct kreq) { + .pname = "/vault", + .path = "Folder", + .suffix = "", + .method = KMETHOD_POST, + }; + ret = del(&r); + + mu_assert("error, POST delete failed!", ret.code <= KHTTP_400); + return 0; +} + static char * test_url_build() { @@ -127,6 +164,8 @@ all_tests() mu_run_test(test_browse_path_too_long); mu_run_test(test_url_build); mu_run_test(test_upload_post); + mu_run_test(test_delete_get); + mu_run_test(test_delete_post); return 0; } -- cgit v1.2.3