Spaces:
Build error
Build error
Download tests/test_config.py from Varun2007/pageparse.ai: direct link, hf CLI and curl.
- Browser
- Download file 639 Bytes
-
https://huggingface.co/spaces/Varun2007/pageparse.ai/resolve/main/tests/test_config.py
- Command line
-
hf download hf://spaces/Varun2007/pageparse.ai/tests/test_config.py
-
curl -L -o test_config.py https://huggingface.co/spaces/Varun2007/pageparse.ai/resolve/main/tests/test_config.py
639 Bytes
| # SPDX-FileCopyrightText: 2026 Team Centurions | |
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| from pathlib import Path | |
| from pageparse.config import Settings | |
| def test_settings_defaults(): | |
| s = Settings() | |
| assert s.airgap is False | |
| assert s.slm_model == "llama3.2:1b" | |
| def test_model_path(): | |
| s = Settings() | |
| p = s.model_path("test.onnx") | |
| assert p.name == "test.onnx" | |
| assert p.parent == s.models_dir | |
| def test_grammar_path(tmp_path: Path): | |
| s = Settings() | |
| s.grammars_dir = tmp_path | |
| (tmp_path / "custom.gbnf").write_text("") | |
| p = s.grammar_path("custom.gbnf") | |
| assert p == tmp_path / "custom.gbnf" | |