"""Test Configs.""" from types import SimpleNamespace import pytest @pytest.fixture def mock_accounting_period_calc_vat_event(): """Mock accounting period calculate vat event.""" return { 'abacus_event_id': 1, 'event_date': '2021-02-01 20:00:00.522342', 'event_name': 'accounting_period_calculate_vat', 'target_id': 2, 'target_type': 'accounting_period', 'user_id': '1', 'user_type': 'orchard-suite' } @pytest.fixture def mock_accounting_period_calc_vat_dag_run( mock_accounting_period_calc_vat_event ): """Mock accounting period calc vat dag run passed between DAG tasks.""" return SimpleNamespace( conf=mock_accounting_period_calc_vat_event) @pytest.fixture() def mock_ows_requests(): """Return fixtures for accounting_period_calculate_vat.""" mock_accounting_period = { 'accounting_period_id': 2, 'accounting_period_name': 'Mock Period 2', 'accounting_period_status': 'locked' } mock_accounting_runs = { 'items': [ { 'run_controller_name': 'Parallel Run Tests', 'summary_export_url': 's3://sales-files/2-mock-period-2/monthly-summary.tsv', # noqa: E501 'accounting_period_id': 2, 'start_date': '2021-11-01', 'accounting_run_id': 11, 'accounting_period_name': 'Mock Period 2', 'accounting_run_status': 'Committed', 'run_controller_id': 22 } ], 'total_count': 1 } mock_csv = 'Col 1\tCol 2\tCol 3\n' \ 'Val 1\tVal 2\tVal 3\n' \ 'Val 11\tVal 22\tVal 33\n' mock_ledger_run_vat_exempt = { 'items': [ { 'gross_vat': None, 'gross_revenue': None, 'country_of_tax_residence': 'GBR', 'exempt_reason': 'Signing Entity does not require VAT' }, { 'gross_vat': None, 'gross_revenue': None, 'country_of_tax_residence': 'USA', 'exempt_reason': 'CTR is tax exempt' } ], 'total_count': 2 } mock_ledger_run_vat_applied = { 'items': [ { 'gross_vat': '255.11', 'gross_revenue': '1440.55', 'country_of_tax_residence': 'GBR', 'exempt_reason': None }, { 'gross_vat': '10', 'gross_revenue': '50', 'country_of_tax_residence': 'GBR', 'exempt_reason': None } ], 'total_count': 2 } mock_abacus_states = [ { 'abacus_state_id': 1, 'action_name': 'calculate_vat' }, { 'abacus_state_id': 2, 'action_name': 'approve_vat_exempt' }, { 'abacus_state_id': 3, 'action_name': 'approve_vat_applied_gbr' } ] return { 'mock_accounting_period': mock_accounting_period, 'mock_accounting_runs': mock_accounting_runs, 'mock_account_tax_info': mock_csv, 'mock_account_payment_terms': mock_csv, 'mock_ledger_run_vat_exempt': mock_ledger_run_vat_exempt, 'mock_ledger_run_vat_applied': mock_ledger_run_vat_applied, 'mock_abacus_states': mock_abacus_states }