Download tests/test_runtime.py from Leon4gr45/openweb: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/Leon4gr45/openweb/resolve/main/tests/test_runtime.py
- Command line
-
hf download hf://spaces/Leon4gr45/openweb/tests/test_runtime.py
-
curl -L -o test_runtime.py https://huggingface.co/spaces/Leon4gr45/openweb/resolve/main/tests/test_runtime.py
1.07 kB
| import sys | |
| from fastapi.testclient import TestClient | |
| from vrag.api import app | |
| def test_cpu_library(): | |
| with TestClient(app) as c: | |
| assert c.get('/api/videos').status_code == 401 | |
| assert len(c.get('/api/demo/videos').json()) == 3 | |
| assert c.get('/api/stats').status_code == 401 | |
| assert c.get('/api/demo/stats').json()['views'] == ['text'] | |
| assert c.get('/api/search?q=test').status_code == 401 | |
| assert c.get('/api/experiments').status_code == 401 | |
| assert not {'torch', 'transformers', 'sentence_transformers', 'vllm'} & sys.modules.keys() | |
| def test_health_and_schema(): | |
| with TestClient(app) as c: | |
| health = c.get('/api/health').json() | |
| assert health['inference'] == 'remote-only' | |
| schema = c.get('/openapi.json').json() | |
| assert '/api/live/sessions/{sid}/frames' in schema['paths'] | |
| def test_config_is_not_public(): | |
| with TestClient(app) as c: | |
| assert c.get('/api/config').status_code == 401 | |
| assert c.post('/api/live/sessions', json={'consent':True}).status_code == 401 | |