Spaces:
Running
Running
Download tests/conftest.py from Liisdotcom/simulator: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/Liisdotcom/simulator/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/Liisdotcom/simulator/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/Liisdotcom/simulator/resolve/main/tests/conftest.py
1.03 kB
| """Pytest fixtures for LiiS Simulator tests.""" | |
| import pytest | |
| from pathlib import Path | |
| import yaml | |
| def products_dir(): | |
| """Return path to products directory.""" | |
| return Path(__file__).parent.parent / "products" | |
| def besafe_config(products_dir): | |
| """Load BeSafe product configuration.""" | |
| config_path = products_dir / "besafe" / "config.yaml" | |
| return yaml.safe_load(config_path.read_text()) | |
| def hamax_config(products_dir): | |
| """Load Hamax product configuration.""" | |
| config_path = products_dir / "hamax" / "config.yaml" | |
| return yaml.safe_load(config_path.read_text()) | |
| def all_configs(products_dir): | |
| """Load all product configurations.""" | |
| configs = {} | |
| for product_dir in products_dir.iterdir(): | |
| if product_dir.is_dir(): | |
| config_path = product_dir / "config.yaml" | |
| if config_path.exists(): | |
| configs[product_dir.name] = yaml.safe_load(config_path.read_text()) | |
| return configs | |