Coverage for core / cache / cache_config.py: 92%
10 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-04 15:08 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-04 15:08 +0000
1# core/cache/cache_config.py
3import yaml
4import os
6BASE_DIR = os.path.dirname(os.path.abspath(__file__))
7DEFAULT_CACHE_DIR = os.path.join(BASE_DIR, ".cache/")
9def load_cache_config(path: str = "config/cache_config.yaml", override_base_dir: bool = True) -> dict:
10 with open(path, "r", encoding="utf-8") as f:
11 config = yaml.safe_load(f)
12 if override_base_dir: 12 ↛ 14line 12 didn't jump to line 14 because the condition on line 12 was always true
13 config['cache']['base_dir'] = DEFAULT_CACHE_DIR
14 return config