Spaces:
Runtime error
Runtime error
Download tests/test_script.sh from ramagururadhakrishnan/DockerAutoGrader: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/spaces/ramagururadhakrishnan/DockerAutoGrader/resolve/main/tests/test_script.sh
- Command line
-
hf download hf://spaces/ramagururadhakrishnan/DockerAutoGrader/tests/test_script.sh
-
curl -L -o test_script.sh https://huggingface.co/spaces/ramagururadhakrishnan/DockerAutoGrader/resolve/main/tests/test_script.sh
530 Bytes
| CONTAINER_ID=$1 | |
| SCORE=0 | |
| # Example Test 1: Endpoint check | |
| RESPONSE=$(docker exec "$CONTAINER_ID" curl -s http://localhost:5000/hello) | |
| EXPECTED="Hello, World!" | |
| if [ "$RESPONSE" == "$EXPECTED" ]; then | |
| SCORE=$((SCORE + 10)) | |
| else | |
| echo "Test 1 failed: Expected '$EXPECTED', got '$RESPONSE'" | |
| fi | |
| # Example Test 2: Check for file existence | |
| docker exec "$CONTAINER_ID" test -f /app/main.py | |
| if [ $? -eq 0 ]; then | |
| SCORE=$((SCORE + 5)) | |
| else | |
| echo "Test 2 failed: main.py not found" | |
| fi | |
| echo $SCORE | |