"""Integration tests for reference-transaction-types.""" import pytest import requests from tests.integration.conftest import ows_abacus_contract_api_client from tests.integration.consts.api import QA_BASE_URL @pytest.mark.jira('ACC-2985', 'PLATFORM-4455') def test_get_reference_transaction_types(auth_headers: dict[str, str]) -> None: """GET /reference-transaction-types endpoint.""" endpoint = '{}/reference-transaction-types'.format(QA_BASE_URL) response_get_transaction_types = requests.get(endpoint, headers=auth_headers) assert response_get_transaction_types.status_code == 200 assert len(response_get_transaction_types.json()) > 0 assert all('txn_type_code' in x and 'txn_type_name' in x for x in response_get_transaction_types.json()) @pytest.mark.jira('PLATFORM-4455') def test_reference_transaction_type_unauthorized( unauthorized_headers: dict[str, str] ) -> None: """Test the GET /reference-transaction-types endpoint with unauthorized headers.""" ows_abacus_contract_client = ows_abacus_contract_api_client(unauthorized_headers) res_get = ows_abacus_contract_client.get_reference_transaction_types() # noqa assert res_get.status_code == 403 expected = { 'code': 'forbidden', 'message': 'User is forbidden' } assert res_get.json() == expected