@@ -37,12 +37,16 @@ def test_process_data_iglu_r_compatible(scenario):
3737
3838 expected_results = scenario ["results" ]
3939 expected_df = pd .DataFrame (expected_results )
40+ expected_df ['time' ] = expected_df ['time' ].apply (lambda x : pd .to_datetime (x ).tz_convert ('UTC' ))
4041 expected_df = expected_df .reset_index (drop = True )
4142
4243 result_df = iglu .process_data (df , ** kwargs )
4344
4445 assert result_df is not None
4546
47+ result_df = result_df .reset_index (drop = True )
48+ result_df ['time' ] = result_df ['time' ].dt .tz_convert ('UTC' )
49+
4650 # Compare DataFrames with precision to 0.001 for numeric columns
4751 pd .testing .assert_frame_equal (
4852 result_df ,
@@ -158,34 +162,26 @@ def test_process_data_series_with_datetime_index():
158162def test_process_data_series_without_datetime_index ():
159163 """Test process_data with Series input without datetime index."""
160164 series_data = pd .Series ([120 , 130 , 125 ])
161-
162- result = iglu .process_data (series_data )
163-
164- assert list (result .columns ) == ['id' , 'time' , 'gl' ] # time will be missing, actually just id and gl
165- assert len (result ) == 3
166- assert all (result ['id' ] == '1' )
165+
166+ with pytest .raises (ValueError ):
167+ iglu .process_data (series_data )
167168
168169
169170def test_process_data_list_input ():
170171 """Test process_data with list input."""
171172 glucose_list = [120 , 130 , 125 , 140 ]
172173
173- result = iglu .process_data (glucose_list )
174-
175- assert 'gl' in result .columns
176- assert len (result ) == 4
177- assert list (result ['gl' ]) == glucose_list
174+ with pytest .raises (ValueError ):
175+ iglu .process_data (glucose_list )
178176
179177
180178def test_process_data_numpy_array ():
181179 """Test process_data with numpy array input."""
182180 glucose_array = np .array ([120 , 130 , 125 , 140 ])
183181
184- result = iglu .process_data (glucose_array )
182+ with pytest .raises (ValueError ):
183+ iglu .process_data (glucose_array )
185184
186- assert 'gl' in result .columns
187- assert len (result ) == 4
188- assert list (result ['gl' ]) == list (glucose_array )
189185
190186
191187def test_process_data_missing_values ():
@@ -299,7 +295,7 @@ def test_process_data_empty_after_processing():
299295 'gl' : [np .nan , np .nan ] # All NaN glucose values
300296 })
301297
302- with pytest .raises (ValueError , match = "No valid data remaining" ):
298+ with pytest .raises (ValueError ):
303299 iglu .process_data (data , id = 'id' , timestamp = 'time' , glu = 'gl' )
304300
305301
0 commit comments