Download tests/test_projects.py from smlflg/meine-linux-app: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/smlflg/meine-linux-app/resolve/main/tests/test_projects.py
- Command line
-
hf download hf://smlflg/meine-linux-app/tests/test_projects.py
-
curl -L -o test_projects.py https://huggingface.co/smlflg/meine-linux-app/resolve/main/tests/test_projects.py
1.15 kB
| from pathlib import Path | |
| from meine_app.projects import ( | |
| discover_profiles, | |
| load_project_config, | |
| project_profile_from_config, | |
| set_project_profile, | |
| ) | |
| def test_discover_profiles_lists_directories(tmp_path: Path): | |
| (tmp_path / "hai-agent-code").mkdir() | |
| (tmp_path / "uniagent").mkdir() | |
| (tmp_path / "not-a-dir.txt").write_text("x", encoding="utf-8") | |
| (tmp_path / ".hidden").mkdir() | |
| profiles = discover_profiles(tmp_path) | |
| assert profiles == ["hai-agent-code", "uniagent"] | |
| def test_project_profile_from_config_prefers_profile(): | |
| assert project_profile_from_config({"profile": "hai-agent-code"}) == "hai-agent-code" | |
| def test_project_profile_from_config_falls_back_to_ziel_agent(): | |
| assert project_profile_from_config({"ziel_agent": "uniagent"}) == "uniagent" | |
| def test_set_project_profile_writes_config(tmp_path: Path): | |
| project = tmp_path / "Demo" | |
| project.mkdir() | |
| config_path = set_project_profile(project, "hai-agent-code") | |
| config = load_project_config(project) | |
| assert config["profile"] == "hai-agent-code" | |
| assert "ziel_agent" not in config | |
| assert config_path.is_file() | |