import requests from tests.integration import config def test_get_label_participant_applications(bearer_token_with_vendor_star): """GET /label-participant/{lp_uuid}/applications.""" response = requests.get( '{qa_base_url}/label-participant/{lp_uuid}/applications'.format( qa_base_url=config.QA_BASE_URL, lp_uuid='f62d7c5b-1d8c-4c1f-b527-f21ea798d337' ), headers={ 'authorization': f'Bearer {bearer_token_with_vendor_star}', }, ) assert response.status_code == 200 expected_applications = [ { 'application_id': 'INSIGHTS_APP', 'roles': ['INSIGHTS_BASE_ROLE'], 'url': 'https://insights.theorchard.com', }, { 'application_id': 'SETTINGS_APP', 'roles': ['SETTINGS_BASE_ROLE'], 'url': 'https://settings.theorchard.com', }, ] assert response.json().get('applications') == expected_applications def test_no_access(bearer_token_without_vendor_star): """GET /label-participant/{lp_uuid}/applications no access.""" response = requests.get( '{qa_base_url}/label-participant/{lp_uuid}/applications'.format( qa_base_url=config.QA_BASE_URL, lp_uuid='f62d7c5b-1d8c-4c1f-b527-f21ea798d337' ), headers={ 'authorization': f'Bearer {bearer_token_without_vendor_star}', }, ) assert response.status_code == 403