supervisor/tests/common.py
Joakim Sørensen 9bcb15dbc0
MVP: Add Network Manager context (#1937)
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-24 16:58:02 +02:00

16 lines
421 B
Python

"""Common test functions."""
import json
from pathlib import Path
def load_json_fixture(filename: str) -> dict:
"""Load a json fixture."""
path = Path(Path(__file__).parent.joinpath("fixtures"), filename)
return json.loads(path.read_text())
def load_fixture(filename: str) -> str:
"""Load a fixture."""
path = Path(Path(__file__).parent.joinpath("fixtures"), filename)
return path.read_text()