"""Unit tests for metadata-consistency-checks logic.""" import pytest from src.common.models.metadata import ReleaseArtistTable from src.logic.consistency_fetch import fetch_product_participations_events class TestFetchProductParticipationsEvents: """Test for fetch_product_participations_events function.""" @pytest.fixture def fetch_ar_records_to_sync(self, mocker): """Mock fetch_ar_records_to_sync function.""" return mocker.patch('src.logic.consistency_fetch.fetch_ar_records_to_sync') @pytest.fixture def encode_records(self, mocker): """Mock encode_records function.""" return mocker.patch('src.logic.consistency_fetch.encode_records') def test_fetch_product_participations_events( self, inconsistency_reports, fetch_ar_records_to_sync, encode_records, inconsistent_release_artist_id): """Test fetch_product_participations_events function.""" result = fetch_product_participations_events(inconsistency_reports) fetch_ar_records_to_sync.assert_called_once_with( ReleaseArtistTable, [inconsistent_release_artist_id]) assert result == encode_records.return_value