pytest-api/tests/oauth_service/conftest.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

77 lines
1.9 KiB
Python

# pylint: disable=line-too-long,unused-argument
import pytest
from apiclient.config import get_cfg
from apiclient.oauth_helper import get_legacy_token
ENV = 'qa'
CFG = get_cfg(ENV, force_refresh=True)
application_json = {'Content-Type': 'application/json'}
@pytest.fixture
def role_get_call(reset_oauth_session):
token = get_legacy_token(ENV)
api_call = {
"token": token,
"method": "GET",
"url": CFG["api_url"] + '/data-delivery/role',
"headers": application_json,
"body": {"application_id": 1}
}
return api_call
@pytest.fixture
def acms_redaction_get_call(reset_oauth_session):
token = get_legacy_token(ENV)
api_call = {
"token": token,
"method": "GET",
"url": CFG["api_url"] + '/data-delivery/acmsredaction',
"headers": application_json,
"body": {"redaction_id": 1}
}
return api_call
@pytest.fixture
def client_applications_get_call(reset_oauth_session):
token = get_legacy_token(ENV)
api_call = {
"token": token,
"method": "GET",
"url": CFG["api_url"] + '/data-delivery/client-applications',
"headers": application_json,
"body": {}
}
return api_call
@pytest.fixture
def endpoint_get_call(reset_oauth_session):
token = get_legacy_token(ENV)
api_call = {
"token": token,
"method": "GET",
"url": CFG["api_url"] + '/data-delivery/endpoint',
"headers": application_json,
"body": {
"endpoint_id": 1001
}
}
return api_call
@pytest.fixture
def redaction_type_get_call(reset_oauth_session):
token = get_legacy_token(ENV)
api_call = {
"token": token,
"method": "GET",
"url": CFG["api_url"] + '/data-delivery/redactiontype',
"headers": application_json,
"body": {}
}
return api_call