File: common.py

package info (click to toggle)
python-xbox-webapi 2.1.0-1.2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,900 kB
  • sloc: python: 4,973; makefile: 79
file content (16 lines) | stat: -rw-r--r-- 365 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import json
import os

TEST_PATH = os.path.dirname(__file__)


def get_response(name):
    """Read a response file."""
    with open(f"{TEST_PATH}/data/responses/{name}.json", encoding="utf8") as f:
        return f.read()


def get_response_json(name):
    """Read a response file and return json dict."""
    text = get_response(name)
    return json.loads(text)