From 49ef0d513dae94343f57469b5edd66680e1f0a0e Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Thu, 13 Apr 2023 14:30:18 +0200 Subject: fix tests --- tests.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tests.sh b/tests.sh index 33a1f91..313f44e 100644 --- a/tests.sh +++ b/tests.sh @@ -13,28 +13,29 @@ mkdir -p tests echo -e ${GREEN}Test: normaler Upload${ENDCOLOR} touch tests/file -curl -X POST -H "token: $TOKEN" -F "file=@tests/file" $URL/upload +curl -X POST -H "token: $TOKEN" -F "file=@tests/file" $URL/upload | jq echo -e ${GREEN}Test: leerer Upload${ENDCOLOR} -curl -X POST -H "token: $TOKEN" -F "file=@" $URL/upload +curl -X POST -H "token: $TOKEN" $URL/upload echo -e ${GREEN}Test: fehlerhafter Dateiname Upload${ENDCOLOR} -touch 'hallo\welt.txt' +touch ./tests/'hallo\welt.txt' curl -X POST -H "token: $TOKEN" -F "file=@tests/hallo\welt.txt" $URL/upload echo -e ${GREEN}Test: List Files${ENDCOLOR} -curl -H "token: $TOKEN" $URL/list +curl -H "token: $TOKEN" $URL/list | jq echo -e ${GREEN}Test: download Datei${ENDCOLOR} wget $URL/download/file -o ./tests/file +ls -lah ./tests/file echo -e ${GREEN}Test: download nicht vorhandene Datei${ENDCOLOR} wget $URL/download/file2 echo -e ${GREEN}Test: lösche Datei${ENDCOLOR} -curl -X DELETE -H "token: $TOKEN" $URL/delete/file +curl -X DELETE -H "token: $TOKEN" $URL/delete/file | jq echo -e ${GREEN}Test: lösche nicht vorhandene Datei${ENDCOLOR} -curl -X DELETE -H "token: $TOKEN" $URL/delete/file2 +curl -X DELETE -H "token: $TOKEN" $URL/delete/file2 | jq rm -rf tests -- cgit v1.2.3