summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Grote2023-04-13 14:30:18 +0200
committerMichael Grote2023-04-13 14:30:18 +0200
commit49ef0d513dae94343f57469b5edd66680e1f0a0e (patch)
treeef6267b3a506b6525db6d0f5067415db9dcc24ae
parent8dce3cd4810c76eec5fc6d50c31a632921f550b3 (diff)
fix tests
-rw-r--r--tests.sh13
1 files 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