Spaces:
Sleeping
Sleeping
Download tests/test_deployment.py from Hoctar77/fedstylevalidator: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/spaces/Hoctar77/fedstylevalidator/resolve/main/tests/test_deployment.py
- Command line
-
hf download hf://spaces/Hoctar77/fedstylevalidator/tests/test_deployment.py
-
curl -L -o test_deployment.py https://huggingface.co/spaces/Hoctar77/fedstylevalidator/resolve/main/tests/test_deployment.py
1.35 kB
| from pathlib import Path | |
| PROJECT_ROOT = Path(__file__).resolve().parents[1] | |
| def test_streamlit_config_disables_xsrf_for_hugging_face_uploads() -> None: | |
| config_text = (PROJECT_ROOT / ".streamlit" / "config.toml").read_text( | |
| encoding="utf-8" | |
| ) | |
| assert "enableXsrfProtection = false" in config_text | |
| def test_dockerfile_passes_xsrf_override_to_streamlit() -> None: | |
| dockerfile_text = (PROJECT_ROOT / "Dockerfile").read_text(encoding="utf-8") | |
| assert "--server.enableXsrfProtection=false" in dockerfile_text | |
| def test_dockerfile_copies_only_runtime_files() -> None: | |
| dockerfile_text = (PROJECT_ROOT / "Dockerfile").read_text(encoding="utf-8") | |
| assert 'COPY --chown=user app.py ./' in dockerfile_text | |
| assert 'COPY --chown=user .streamlit ./.streamlit' in dockerfile_text | |
| assert "COPY --chown=user src ./src" in dockerfile_text | |
| assert "COPY --chown=user . ." not in dockerfile_text | |
| def test_dockerignore_excludes_non_runtime_repo_files() -> None: | |
| dockerignore_text = (PROJECT_ROOT / ".dockerignore").read_text(encoding="utf-8") | |
| assert "AGENTS.md" in dockerignore_text | |
| assert "CLAUDE.md" in dockerignore_text | |
| assert "CLAUDE_CODE_UPDATES.md" in dockerignore_text | |
| assert "PRD.md" in dockerignore_text | |
| assert "docs" in dockerignore_text | |
| assert "tests" in dockerignore_text | |