Files
mdcaldav/tests/conftest.py
Tyler Perkins 8b5cd370ea
Some checks failed
CI / test (push) Failing after 11s
CI / image (push) Has been skipped
Initial commit
2026-08-01 21:03:35 -04:00

33 lines
629 B
Python

from __future__ import annotations
import shutil
from pathlib import Path
import pytest
from mdcaldav.config import Config
from mdcaldav.parser import parse_file
FIXTURE_VAULT = Path(__file__).parent / "fixtures" / "vault"
@pytest.fixture
def cfg() -> Config:
return Config()
@pytest.fixture
def vault(tmp_path: Path) -> Path:
"""A writable copy of the real note fixtures."""
dest = tmp_path / "vault"
shutil.copytree(FIXTURE_VAULT, dest)
return dest
@pytest.fixture
def tasks_of(cfg: Config):
def _load(vault: Path, rel: str):
return parse_file(vault / rel, rel, cfg)
return _load