From 7d1e1589b6c61f7d038b0c8a072098784e9deb92 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 25 Mar 2022 13:53:27 +0100 Subject: [PATCH] add file_json --- tests/conftest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 991374ba..b4e97af0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,5 @@ import io +import json import uuid import jwt import ereuse_utils @@ -166,6 +167,11 @@ def file(name: str) -> dict: return json_encode(yaml2json(name)) +def file_json(name): + with Path(__file__).parent.joinpath('files').joinpath(name).open() as f: + return json.loads(f.read()) + + def file_workbench(name: str) -> dict: """Opens and parses a YAML file from the ``files`` subdir.""" with Path(__file__).parent.joinpath('workbench_files').joinpath(name + '.json').open() as f: