test: Edge-Case-Dateien + Tests (leer/gross/verschluesselt/Sonderzeichen)
/testdata/edge/: empty.txt, leer.bin (0 Byte), Name mit Umlauten+Leerzeichen+ Klammern, Unicode/Emoji/RTL-Inhalt, Datei ohne Endung, passwortgeschuetztes PDF (pikepdf) + ZIP, riesig.dat (26 MB > MAX_BIN_SIZE). TestFileEdgeCases prueft graceful Handling (kein Crash, 'Datei zu gross', PDF-Lesefehler sauber gemeldet). gen_edge.py + upload_ocis.sh erweitert. 76 Tests gruen.
This commit is contained in:
Vendored
+10
@@ -9,3 +9,13 @@ curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/" || true
|
||||
for d in images audio video documents text archives; do curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/$d/" || true; done
|
||||
for f in /tmp/mcptest-files/*; do n=$(basename "$f"); curl -s -o /dev/null -u "$AUTH" -T "$f" "$BASE/testdata/$(sub "$n")/$n"; done
|
||||
echo "Upload fertig."
|
||||
# Edge-Cases (/tmp/mcptest-files-edge -> /testdata/edge/, URL-encoded)
|
||||
if [ -d /tmp/mcptest-files-edge ]; then
|
||||
curl -s -o /dev/null -u "$AUTH" -X MKCOL "$BASE/testdata/edge/" || true
|
||||
python3 - "$OCIS_PW" <<'PYEOF'
|
||||
import os,sys,subprocess,urllib.parse
|
||||
pw=sys.argv[1]; B="http://127.0.0.1:9200/remote.php/dav/files/mcptest/testdata/edge"
|
||||
for f in sorted(os.listdir("/tmp/mcptest-files-edge")):
|
||||
subprocess.run(["curl","-s","-o","/dev/null","-u",f"mcptest:{pw}","-T",f"/tmp/mcptest-files-edge/{f}",f"{B}/{urllib.parse.quote(f)}"])
|
||||
PYEOF
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user