fix tests

This commit is contained in:
Michael Grote 2023-04-13 14:30:18 +02:00
parent 8dce3cd481
commit 49ef0d513d

View file

@ -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