Spaces:
Paused
Paused
Download tests/test_template_navigation.py from BPEL/otree-server: direct link, hf CLI and curl.
- Browser
- Download file 814 Bytes
-
https://huggingface.co/spaces/BPEL/otree-server/resolve/main/tests/test_template_navigation.py
- Command line
-
hf download hf://spaces/BPEL/otree-server/tests/test_template_navigation.py
-
curl -L -o test_template_navigation.py https://huggingface.co/spaces/BPEL/otree-server/resolve/main/tests/test_template_navigation.py
814 Bytes
| from pathlib import Path | |
| PROJECT_DIR = Path(__file__).resolve().parents[1] | |
| def assert_results_has_next(app_dir: Path): | |
| results = app_dir / 'Results.html' | |
| assert results.exists(), f"Missing Results.html in {app_dir.name}" | |
| text = results.read_text(encoding='utf-8') | |
| assert '{{ next_button }}' in text, ( | |
| f"Results.html in {app_dir.name} is missing '{{ next_button }}' — " | |
| "participants cannot proceed to the next app in a sequence" | |
| ) | |
| def test_classic_sequence_has_next_buttons(): | |
| # Apps in classic_baseline sequence expected to have a next button on Results | |
| for app in ['prisoner', 'trust_simple', 'public_goods_simple']: | |
| app_dir = PROJECT_DIR / app | |
| assert app_dir.exists(), f"App folder not found: {app}" | |
| assert_results_has_next(app_dir) | |