"""Integration tests.""" import requests from tests.integration.config import QA_BASE_URL def test_apple_music_search(): """Get service/apple-music/search Endpoint.""" response = requests.get( f'{QA_BASE_URL}/service/apple-music/search', { 'query': 'Charlotte Haining', }, ) assert response.status_code == 200, '\nReason: {}\nURL: {}'.format( response.reason, response.url ) response_body = response.json() assert len(response_body) == 1 assert 'identifier' in response_body[0] assert 'name' in response_body[0] assert response_body[0]['name'] == 'Charlotte Haining' def test_spotify_search(): """Get service/spotify/search Endpoint.""" response = requests.get( f'{QA_BASE_URL}/service/spotify/search', { 'query': 'Charlotte Haining', }, ) assert response.status_code == 200, '\nReason: {}\nURL: {}'.format( response.reason, response.url ) response_body = response.json() assert len(response_body) >= 1 assert 'identifier' in response_body[0] assert 'name' in response_body[0] assert response_body[0]['name'] == 'Charlotte Haining'