Spaces:
Sleeping
Sleeping
Download test_hf_deploy_workflow.py from shazhass/phytoevidence-api: direct link, hf CLI and curl.
- Browser
- Download file 748 Bytes
-
https://huggingface.co/spaces/shazhass/phytoevidence-api/resolve/main/test_hf_deploy_workflow.py
- Command line
-
hf download hf://spaces/shazhass/phytoevidence-api/test_hf_deploy_workflow.py
-
curl -L -o test_hf_deploy_workflow.py https://huggingface.co/spaces/shazhass/phytoevidence-api/resolve/main/test_hf_deploy_workflow.py
748 Bytes
| from pathlib import Path | |
| WORKFLOW = Path(__file__).parent / ".github/workflows/deploy-huggingface-space.yml" | |
| def test_hf_deploy_is_manual_and_uses_scoped_secret(): | |
| content = WORKFLOW.read_text(encoding="utf-8") | |
| assert "workflow_dispatch:" in content | |
| assert "github.event.inputs.confirm == 'DEPLOY'" in content | |
| assert "secrets.HF_WRITE_TOKEN" in content | |
| assert "\n push:" not in content | |
| def test_hf_deploy_verifies_exact_revision_and_health(): | |
| content = WORKFLOW.read_text(encoding="utf-8") | |
| assert "data.get(\"sha\") == os.environ[\"EXPECTED_SHA\"]" in content | |
| assert 'runtime.get("stage") == "RUNNING"' in content | |
| assert 'health.get("status") != "ok"' in content | |
| assert "rsync -a --delete" in content | |