mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-04-20 19:27:16 +00:00
![dependabot[bot]](/assets/img/avatar_default.png)
* Bump pylint from 2.10.2 to 2.11.1 Bumps [pylint](https://github.com/PyCQA/pylint) from 2.10.2 to 2.11.1. - [Release notes](https://github.com/PyCQA/pylint/releases) - [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog) - [Commits](https://github.com/PyCQA/pylint/compare/v2.10.2...v2.11.1) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Fix linter issues * fix tests lint Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
22 lines
630 B
Python
22 lines
630 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(encoding="utf-8"))
|
|
|
|
|
|
def load_fixture(filename: str) -> str:
|
|
"""Load a fixture."""
|
|
path = Path(Path(__file__).parent.joinpath("fixtures"), filename)
|
|
return path.read_text(encoding="utf-8")
|
|
|
|
|
|
def exists_fixture(filename: str) -> bool:
|
|
"""Check if a fixture exists."""
|
|
path = Path(Path(__file__).parent.joinpath("fixtures"), filename)
|
|
return path.exists()
|