"""Test GET /profile/profile_id//profile_type/.""" import uuid import requests from tests.integration import config def test_get_profile_by_id(new_profile, grass_headers): """Test getting a profile by id (and type).""" profile_id = new_profile['profile_id'] profile_type = new_profile['profile_type'] res = requests.get( f'{config.QA_BASE_URL}/profile/profile_id/{profile_id}/profile_type/{profile_type}', headers=grass_headers, ) assert res.status_code == 200 body = res.json() for key, value in new_profile.items(): assert body[key] == value def test_get_nonexistent_profile(grass_headers): """Test attempting to get a nonexistent profile by id (and type).""" profile_id = uuid.uuid4() profile_type = 'InsightsProfile' res = requests.get( f'{config.QA_BASE_URL}/profile/profile_id/{profile_id}/profile_type/{profile_type}', headers=grass_headers, ) assert res.status_code == 404 body = res.json() assert body['code'] == 'not_found_error' assert body['message'] == 'Profile not found'