"""Shared fixtures.""" import json import pytest TEST_URL = 'https://www.tiktok.com/@bts_official_bighit' TEST_PAGE_FILE = 'tests/tiktok_artist_page.html' TEST_ALTERNATIVE_PAGE_FILE = 'tests/tiktok_artist_page_alternative.html' TEST_FOREIGN_PAGE_FILE = 'tests/tiktok_artist_page_foreign.html' TEST_BROKEN_FILE = 'tests/tiktok_broken_artist_page.html' TEST_CAPTCHA_FILE = 'tests/tiktok_captcha_page.html' @pytest.fixture def mock_tiktok_url(): """Mock Tiktok URL.""" return TEST_URL @pytest.fixture(params=[TEST_PAGE_FILE, TEST_ALTERNATIVE_PAGE_FILE, TEST_FOREIGN_PAGE_FILE]) def mock_artist_page(request): """Test artist page from Tiktok.""" with open(request.param) as f: page = f.read() return page @pytest.fixture def mock_broken_artist_page(): """Test broken artist page from Tiktok.""" with open(TEST_BROKEN_FILE) as f: page = f.read() return page @pytest.fixture def mock_captcha_page(): """Test CAPTCHA page from Tiktok.""" with open(TEST_CAPTCHA_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)