@@ -79,18 +79,14 @@ def test_diff_view_no_duplicate_id_paths(session_fv2410_fv2504_with_diff_view: S
7979 Test that there are no duplicate id_paths for the same version pair comparison.
8080 Each id_path should appear exactly once in the diff results.
8181 """
82- result = session_fv2410_fv2504_with_diff_view .execute (
83- text (
84- """
82+ result = session_fv2410_fv2504_with_diff_view .execute (text ("""
8583 SELECT id_path, COUNT(*) as cnt
8684 FROM v_ahb_diff
8785 WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
8886 AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
8987 GROUP BY id_path
9088 HAVING COUNT(*) > 1
91- """
92- )
93- )
89+ """ ))
9490 duplicates = list (result )
9591 assert len (duplicates ) == 0 , f"Found duplicate id_paths in diff results: { duplicates [:5 ]} "
9692
@@ -100,9 +96,7 @@ def test_diff_view_added_rows_have_null_old_columns(session_fv2410_fv2504_with_d
10096 Test that 'added' rows have NULL values for old_* columns and populated new_* columns.
10197 This verifies the SQL is correctly setting NULL for the old version.
10298 """
103- result = session_fv2410_fv2504_with_diff_view .execute (
104- text (
105- """
99+ result = session_fv2410_fv2504_with_diff_view .execute (text ("""
106100 SELECT
107101 SUM(CASE WHEN old_segment_code IS NOT NULL THEN 1 ELSE 0 END) as old_segment_not_null,
108102 SUM(CASE WHEN old_line_ahb_status IS NOT NULL THEN 1 ELSE 0 END) as old_status_not_null,
@@ -111,9 +105,7 @@ def test_diff_view_added_rows_have_null_old_columns(session_fv2410_fv2504_with_d
111105 WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
112106 AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
113107 AND diff_status = 'added'
114- """
115- )
116- )
108+ """ ))
117109 row = list (result )[0 ]
118110 assert row [0 ] == 0 , "Added rows should have NULL old_segment_code"
119111 assert row [1 ] == 0 , "Added rows should have NULL old_line_ahb_status"
@@ -125,9 +117,7 @@ def test_diff_view_deleted_rows_have_null_new_columns(session_fv2410_fv2504_with
125117 Test that 'deleted' rows have NULL values for new_* columns and populated old_* columns.
126118 This verifies the SQL is correctly setting NULL for the new version.
127119 """
128- result = session_fv2410_fv2504_with_diff_view .execute (
129- text (
130- """
120+ result = session_fv2410_fv2504_with_diff_view .execute (text ("""
131121 SELECT
132122 SUM(CASE WHEN new_segment_code IS NOT NULL THEN 1 ELSE 0 END) as new_segment_not_null,
133123 SUM(CASE WHEN new_line_ahb_status IS NOT NULL THEN 1 ELSE 0 END) as new_status_not_null,
@@ -136,9 +126,7 @@ def test_diff_view_deleted_rows_have_null_new_columns(session_fv2410_fv2504_with
136126 WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
137127 AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
138128 AND diff_status = 'deleted'
139- """
140- )
141- )
129+ """ ))
142130 row = list (result )[0 ]
143131 assert row [0 ] == 0 , "Deleted rows should have NULL new_segment_code"
144132 assert row [1 ] == 0 , "Deleted rows should have NULL new_line_ahb_status"
@@ -150,18 +138,14 @@ def test_diff_view_modified_rows_have_actual_differences(session_fv2410_fv2504_w
150138 Test that 'modified' rows actually have differences in at least one compared field.
151139 This verifies the CASE statement logic is correct.
152140 """
153- result = session_fv2410_fv2504_with_diff_view .execute (
154- text (
155- """
141+ result = session_fv2410_fv2504_with_diff_view .execute (text ("""
156142 SELECT id_path, old_line_ahb_status, new_line_ahb_status,
157143 old_line_name, new_line_name, old_bedingung, new_bedingung
158144 FROM v_ahb_diff
159145 WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
160146 AND old_pruefidentifikator = '55109' AND new_pruefidentifikator = '55109'
161147 AND diff_status = 'modified'
162- """
163- )
164- )
148+ """ ))
165149 for row in result :
166150 id_path , old_status , new_status , old_name , new_name , old_bed , new_bed = row
167151 # At least one of status, name, or bedingung must be different
@@ -175,15 +159,11 @@ def test_diff_view_nonexistent_pruefi_returns_empty(session_fv2410_fv2504_with_d
175159 """
176160 Test that querying a non-existent prüfidentifikator returns empty results.
177161 """
178- result = session_fv2410_fv2504_with_diff_view .execute (
179- text (
180- """
162+ result = session_fv2410_fv2504_with_diff_view .execute (text ("""
181163 SELECT COUNT(*) FROM v_ahb_diff
182164 WHERE old_format_version = 'FV2410' AND new_format_version = 'FV2504'
183165 AND old_pruefidentifikator = '99999' AND new_pruefidentifikator = '99999'
184- """
185- )
186- )
166+ """ ))
187167 count = list (result )[0 ][0 ]
188168 assert count == 0 , "Non-existent prüfi should return no results"
189169
0 commit comments