"""Integration tests.""" import requests from tests.integration.config import QA_BASE_URL def test_contact_with_id(): """Get contact Endpoint.""" response = requests.post( f'{QA_BASE_URL}/contact', json={ 'participant_id': 1234, 'participant_name': 'test', 'message': 'test', 'vendor_id': 7924, 'subaccount_id': 0, }, headers={ 'grass-account-id': '7924', 'grass-account-type': 'vendor', 'orchard-identity-id': '5d2caf767297220dd220e212', 'orchard-identity-uuid': '0bc32614-540d-4b7b-8d2f-02054bfba86b', 'orchard-roles': 'catalog,marketing,advertising', 'orchard-user-id': 'alw:7836', }, ) assert response.status_code == 200, '\nReason: {}\nURL: {}'.format( response.reason, response.url ) def test_contact_with_uuid(): """Get contact Endpoint.""" response = requests.post( f'{QA_BASE_URL}/contact', json={ 'participant_id': 'e5f88f16-aeec-43ba-8d8a-60a392625171', 'participant_name': 'test', 'message': 'test', 'vendor_id': 7924, 'subaccount_id': 0, }, headers={ 'grass-account-id': '7924', 'grass-account-type': 'vendor', 'orchard-identity-id': '5d2caf767297220dd220e212', 'orchard-identity-uuid': '0bc32614-540d-4b7b-8d2f-02054bfba86b', 'orchard-roles': 'catalog,marketing,advertising', 'orchard-user-id': 'alw:7836', }, ) assert response.status_code == 200, '\nReason: {}\nURL: {}'.format( response.reason, response.url ) def test_lookup_participants_with_uuids() -> None: """POST /lookup/label-participants/uuids/tenant-hierarchy/ endpoint.""" response = requests.post( f'{QA_BASE_URL}/lookup/label-participants/uuids/tenant-hierarchy', json={ 'uuids': [ '715ab136-e896-4cb7-9c3f-becedcf7cdcc', '42d022c2-50e4-4f5c-af30-f10dca6b8a50', '54381846-a817-4ef4-9e58-7eae15bcf1dd', ], }, ) assert response.status_code == 200, '\nReason: {}\nURL: {}'.format( response.reason, response.url ) assert response.json() == { 'label_participants': [ { 'uuid': '715ab136-e896-4cb7-9c3f-becedcf7cdcc', 'vendor_uuid': 'b40430ee-4acb-4c14-b3ef-35b3c01869c7', 'company_brand_uuid': 'd25a4cd1-e820-45f2-be5c-56edcfeb8298', 'parent_company_uuid': '955a1bbd-b623-4ea1-ab5f-8d6620c442fb', 'subaccount_uuid': '184f1303-0c64-4d90-9715-6838e5cded31', }, None, { 'uuid': '54381846-a817-4ef4-9e58-7eae15bcf1dd', 'vendor_uuid': '0757c0f1-4bcb-41ef-b8e0-1e980effe998', 'company_brand_uuid': 'd25a4cd1-e820-45f2-be5c-56edcfeb8298', 'parent_company_uuid': '955a1bbd-b623-4ea1-ab5f-8d6620c442fb', 'subaccount_uuid': None, }, ] }