"""conftest.""" import json from pathlib import Path from pytest import fixture @fixture def mock_statement_periods(): """Mock statement periods.""" return {2026: {1: 325, 2: 326}} @fixture def mock_reference_adjustment_types(): """Mock reference_adjustment_types.""" return {'label earnings': 1, 'publisher earnings': 2, 'legal fees': 3} @fixture def mock_event(): """Mock abacus event.""" sample_event_path = Path(__file__).parents[2] / 'tests/sample_event.json' with open(sample_event_path, 'r') as f: event = json.load(f) return event @fixture def mock_adjustments_json_file_content(): """Mock adjustments json.""" return [ { 'account_id': '68952', 'contract_id': '533565', 'upc': None, 'amount': '-50.8979990', 'currency': 'USD', 'activity_year': 2026, 'activity_month': 1, 'statement_year': 2026, 'statement_month': 2, 'adjustment_type': 'Label Earnings', 'client_facing_comments': 'comment', 'distribution_type': None, 'internal_note': None, 'apply_to_flowthrough_payment': 'Y', }, { 'account_id': '123456', 'contract_id': '908781', 'upc': None, 'amount': '-50.8979990', 'currency': 'USD', 'activity_year': 2026, 'activity_month': 1, 'statement_year': 2026, 'statement_month': 2, 'adjustment_type': 'Publisher Earnings', 'client_facing_comments': 'comment', 'distribution_type': None, 'internal_note': None, 'apply_to_flowthrough_payment': 'Y', }, ] @fixture def mock_adjustments_json_content_special_characters(): """Mock adjustments json file data with special characters.""" return [ { 'account_id': '68952\u200b', 'contract_id': '533565 ', 'upc': None, 'amount': '-50.8979990', 'currency': 'USD', 'activity_year': 2026, 'activity_month': 1, 'statement_year': 2026, 'statement_month': 2, 'adjustment_type': 'Label Earnings', 'client_facing_comments': 'comment', 'distribution_type': None, 'internal_note': None, 'apply_to_flowthrough_payment': 'Y', }, { 'account_id': '123456', 'contract_id': '908781', 'upc': None, 'amount': '-50.8979990', 'currency': 'USD', 'activity_year': 2026, 'activity_month': 1, 'statement_year': 2026, 'statement_month': 2, 'adjustment_type': 'Publisher Earnings', 'client_facing_comments': 'comment', 'distribution_type': None, 'internal_note': None, 'apply_to_flowthrough_payment': 'Y', }, ] @fixture def mock_statement_periods_list(): """Mock statement periods list.""" return [ { 'statement_period_id': 1, 'statement_period_name': 'January 2026', 'statement_period_status': 'closed', 'statement_month': 1, 'statement_year': 2026, }, { 'statement_period_id': 2, 'statement_period_name': 'February 2026', 'statement_period_status': 'current', 'statement_month': 2, 'statement_year': 2026, }, ] @fixture def mock_reference_adjustment_types_list(): """Mock reference_adjustment_types list.""" return [ {'reference_adjustment_type_id': 1, 'type_name': 'label earnings'}, {'reference_adjustment_type_id': 2, 'type_name': 'reclass between labels'}, ]