"""Shared fixtures.""" import json import pytest TEST_ARTIST_ID = '12Chz98pHFMPJEknJQMWvI' TEST_PAGE_FILE = 'tests/spotify_artist_page.html' TEST_TOTALLY_BROKEN_FILE = 'tests/spotify_totally_broken_artist_page.html' TEST_BROKEN_FILE_NO_ABOUT_BLOCK = 'tests/spotify_broken_artist_page_no_about_block.html' @pytest.fixture def mock_artist_id(): """Test Spotify artist id.""" return TEST_ARTIST_ID @pytest.fixture def mock_artist_page(): """Test artist page from Spotify.""" with open(TEST_PAGE_FILE) as f: page = f.read() return page @pytest.fixture def mock_broken_artist_page_no_about_block(): """Test artist page from Spotify.""" with open(TEST_BROKEN_FILE_NO_ABOUT_BLOCK) as f: page = f.read() return page @pytest.fixture def mock_totally_broken_artist_page(): """Test broken artist page from Spotify.""" with open(TEST_TOTALLY_BROKEN_FILE) as f: page = f.read() return page @pytest.fixture def mock_event(): """Sample lambda event.""" with open('tests/sample_event.json') as f: return json.load(f)