Spaces:
Running
Running
File size: 1,026 Bytes
85fcbc2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | """Pytest fixtures for LiiS Simulator tests."""
import pytest
from pathlib import Path
import yaml
@pytest.fixture
def products_dir():
"""Return path to products directory."""
return Path(__file__).parent.parent / "products"
@pytest.fixture
def besafe_config(products_dir):
"""Load BeSafe product configuration."""
config_path = products_dir / "besafe" / "config.yaml"
return yaml.safe_load(config_path.read_text())
@pytest.fixture
def hamax_config(products_dir):
"""Load Hamax product configuration."""
config_path = products_dir / "hamax" / "config.yaml"
return yaml.safe_load(config_path.read_text())
@pytest.fixture
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
|