Spaces:
Paused
Paused
Download backend/tests/test_plot_titles.py from yrlllllllllll/MindPulse: direct link, hf CLI and curl.
- Browser
- Download file 846 Bytes
-
https://huggingface.co/spaces/yrlllllllllll/MindPulse/resolve/main/backend/tests/test_plot_titles.py
- Command line
-
hf download hf://spaces/yrlllllllllll/MindPulse/backend/tests/test_plot_titles.py
-
curl -L -o test_plot_titles.py https://huggingface.co/spaces/yrlllllllllll/MindPulse/resolve/main/backend/tests/test_plot_titles.py
846 Bytes
| from pathlib import Path | |
| import sys | |
| PROJECT_BACKEND_DIR = Path(__file__).resolve().parents[1] | |
| if str(PROJECT_BACKEND_DIR) not in sys.path: | |
| sys.path.insert(0, str(PROJECT_BACKEND_DIR)) | |
| from app.services.model_service import _build_compact_plot_title | |
| def test_build_compact_plot_title_truncates_long_filename() -> None: | |
| title = _build_compact_plot_title( | |
| "Top 3 Global Links", | |
| "100610_MOVIE1_7T_AP_shen268_roi_ts_gsr_super_long_file_name.txt", | |
| max_file_chars=18, | |
| ) | |
| assert title.startswith("Top 3 Global Links | ") | |
| assert title.endswith("...") | |
| assert "100610_MOVIE1_7T_AP_shen268_roi_ts_gsr_super_long_file_name" not in title | |
| def test_build_compact_plot_title_without_filename() -> None: | |
| title = _build_compact_plot_title("Top 3 Global Links", "") | |
| assert title == "Top 3 Global Links" | |