Spaces:
Sleeping
Sleeping
Download tests/test_app.py from sancloudmlops/flask-random-fruit: direct link, hf CLI and curl.
- Browser
- Download file 424 Bytes
-
https://huggingface.co/spaces/sancloudmlops/flask-random-fruit/resolve/main/tests/test_app.py
- Command line
-
hf download hf://spaces/sancloudmlops/flask-random-fruit/tests/test_app.py
-
curl -L -o test_app.py https://huggingface.co/spaces/sancloudmlops/flask-random-fruit/resolve/main/tests/test_app.py
424 Bytes
| import sys | |
| import os | |
| sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) | |
| from app import app | |
| def test_home(): | |
| client = app.test_client() | |
| response = client.get("/") | |
| assert response.status_code == 200 | |
| def test_random_fruit(): | |
| client = app.test_client() | |
| response = client.get("/random-fruit") | |
| assert response.status_code == 200 | |
| assert "fruit" in response.get_json() |