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