from unittest import mock import pytest from slz_prepare_configuration.handler import is_historical_validation_enabled @pytest.mark.parametrize( 'lambda_event, config, expected', [ ( { 'report_type': 'any', 'dsp': 'any', 'version': 'v1234' }, { 'enable_historical_validation': True }, True, ), ( { 'report_type': 'any', 'dsp': 'any', 'version': 'v1234' }, { 'enable_historical_validation': False }, False, ), ( { 'report_type': 'any', 'dsp': 'youtubereporting', 'version': 'v1234' }, { 'enable_historical_validation': True }, True, ), ( { 'report_type': 'active_claims', 'dsp': 'youtubereporting', 'version': 'v1234' }, { 'enable_historical_validation': True }, True, ), ( { 'report_type': 'active_claims', 'dsp': 'youtubereporting', 'version': 'a1' }, { 'enable_historical_validation': True }, True, ), ( { 'report_type': 'any', 'dsp': 'appreciationengine', 'version': 'any' }, { 'enable_historical_validation': True }, False, ) ] ) def test_is_historical_validation_enabled(lambda_event, config, expected): result = is_historical_validation_enabled(lambda_event, config) assert result == expected