diff options
| author | Michael Grote | 2023-04-13 14:30:18 +0200 |
|---|---|---|
| committer | Michael Grote | 2023-04-13 14:30:18 +0200 |
| commit | 49ef0d513dae94343f57469b5edd66680e1f0a0e (patch) | |
| tree | ef6267b3a506b6525db6d0f5067415db9dcc24ae /tests.sh | |
| parent | 8dce3cd4810c76eec5fc6d50c31a632921f550b3 (diff) | |
fix tests
Diffstat (limited to 'tests.sh')
| -rw-r--r-- | tests.sh | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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 |