21 lines
522 B
Python
21 lines
522 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
import yaml
|
|
|
|
from app.config import ActiveConfig, validate_config
|
|
|
|
|
|
@pytest.fixture
|
|
def artifacts() -> Path:
|
|
return Path(__file__).parents[1] / "app" / "artifacts"
|
|
|
|
|
|
@pytest.fixture
|
|
def active_config(artifacts: Path) -> ActiveConfig:
|
|
document = yaml.safe_load((artifacts / "seed-config.yaml").read_text(encoding="utf-8"))
|
|
rules, detector, _ = validate_config(document, artifacts)
|
|
return ActiveConfig(1, document, rules, detector)
|