From 6aa6071fceab25de21e2ee3afe877432dad24011 Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Tue, 8 Jul 2025 16:37:41 -0300 Subject: [PATCH] SIENTIAPDE-1110 Refactor test cases in test_gates.py to update filter configurations, extracting policy into a dictionary format for improved clarity and consistency in data quality gate tests. --- tests/activities/test_gates.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/tests/activities/test_gates.py b/tests/activities/test_gates.py index 366829a..ab5b0a4 100644 --- a/tests/activities/test_gates.py +++ b/tests/activities/test_gates.py @@ -32,7 +32,9 @@ async def test_data_quality_gate_with_null_values_filter_discard(gates_fixture): # Setup test data input_data = { 'filters': { - 'NULL_VALUES_FILTER': 'DISCARD' + 'NULL_VALUES_FILTER': { + 'policy': 'DISCARD' + } }, 'data': { 'tag': ['tag1', 'tag2', 'tag3'], @@ -62,7 +64,9 @@ async def test_data_quality_gate_with_out_of_bounds_filter_keep(gates_fixture): # Setup test data with out of bounds values input_data = { 'filters': { - 'OUT_OF_BOUNDS_FILTER': 'KEEP' + 'OUT_OF_BOUNDS_FILTER': { + 'policy': 'KEEP' + } }, 'data': { 'tag': ['tag1', 'tag2', 'tag3'], @@ -95,8 +99,12 @@ async def test_data_quality_gate_with_multiple_filters(gates_fixture): # Setup test data input_data = { 'filters': { - 'NULL_VALUES_FILTER': 'DISCARD', - 'OUT_OF_BOUNDS_FILTER': 'DISCARD' + 'NULL_VALUES_FILTER': { + 'policy': 'DISCARD' + }, + 'OUT_OF_BOUNDS_FILTER': { + 'policy': 'DISCARD' + } }, 'data': { 'tag': ['tag1', 'tag2', 'tag3', 'tag4'], @@ -129,7 +137,9 @@ async def test_data_quality_gate_with_unknown_filter(gates_fixture): gates_fixture.warning = MagicMock() input_data = { 'filters': { - 'UNKNOWN_FILTER': 'DISCARD' + 'UNKNOWN_FILTER': { + 'policy': 'DISCARD' + } }, 'data': { 'tag': ['tag1'], @@ -160,7 +170,9 @@ async def test_data_quality_gate_with_filter_error(gates_fixture): # Setup test data input_data = { 'filters': { - 'NULL_VALUES_FILTER': 'DISCARD' + 'NULL_VALUES_FILTER': { + 'policy': 'DISCARD' + } }, 'data': { 'tag': ['tag1'], @@ -199,7 +211,9 @@ async def test_data_quality_gate_with_empty_data(gates_fixture): # Setup empty input data input_data = { 'filters': { - 'NULL_VALUES_FILTER': 'DISCARD' + 'NULL_VALUES_FILTER': { + 'policy': 'DISCARD' + } }, 'data': { 'tag': [],