def load_func_mockjson() -> ResponseFixture:
    "load mock json by function nane"
    fname = inspect.stack()[1][3]
    filename = fname.replace("test_", "") + ".json"
    try:
        with open(os.path.join(JSON_FIXTURES_DIR, filename)) as fp:
            resp_text = fp.read()
            return ResponseFixture(
                status_code=200,
                headers={},
                json_data=json.loads(resp_text),
                text_data=resp_text,
            )
    except FileNotFoundError:
        logger.error(
            "Unable to read JSON fixtures from %s (`JSON_FIXTURES_DIR`: %s)",
            filename,
            JSON_FIXTURES_DIR,
        )
        raise
load mock json by function nane
tests/utils.py