pytest-api/apiclient/demo.py
Greg Gauthier a727c58cf3
All checks were successful
Pylint / build (3.12) (push) Successful in 9s
execute / build (3.12) (push) Successful in 25s
code cleanup for pylint
2024-07-22 19:26:27 +01:00

23 lines
567 B
Python

import json
from apiclient.client import api_client
from apiclient.config import get_cfg
from apiclient.oauth_helper import get_legacy_token
ENV = 'qa'
cfg = get_cfg(ENV)
if __name__ == "__main__":
token = get_legacy_token(ENV)
api_call = {
"token": token,
"method": "GET",
"url": cfg["api_url"] + '/data-delivery/role',
"headers": {'Content-Type': 'application/json'},
"body": {"application_id": 1}
}
api_response = api_client(api_call)
print(json.dumps(api_response, indent=4))