"""Test fixtures for sales_get_eligible unit tests.""" from types import SimpleNamespace import pytest from lib.constants import DAG_SALES_GET_ELIGIBLE_TARGET_TYPE @pytest.fixture def mock_sales_get_eligible_event(): """Mock abacus_event that triggers the sales_get_eligible dag.""" return { 'abacus_event_id': 1, 'event_date': '2022-09-15 18:57:21.590679', 'event_name': 'get_eligible_sales', 'target_id': 123, 'target_type': DAG_SALES_GET_ELIGIBLE_TARGET_TYPE, # 'sales_file' 'created_by': 'default_user_id' } @pytest.fixture def mock_sales_get_eligible_dag_run(mock_sales_get_eligible_event): """Mock sales_get_eligible dag run config.""" return SimpleNamespace(conf=mock_sales_get_eligible_event) @pytest.fixture def mock_sales_file_abacus_states(): """Mock abacus_state records for a sales_file.""" return [ { 'abacus_state_id': 1, 'action_name': 'get_eligible_sales', 'action_status': 'init' }, { 'abacus_state_id': 2, 'action_name': 'approve_sales', 'action_status': 'init' } ]