77
88from diffpy .labpdfproc .labpdfprocapp import get_args
99from diffpy .labpdfproc .tools import (
10- _load_wavelength_from_config_file ,
1110 known_sources ,
1211 load_metadata ,
1312 load_package_info ,
1413 load_user_info ,
1514 load_user_metadata ,
15+ load_wavelength_from_config_file ,
1616 preprocessing_args ,
1717 set_input_lists ,
1818 set_mud ,
@@ -200,9 +200,13 @@ def test_set_output_directory_bad(user_filesystem):
200200@pytest .mark .parametrize (
201201 "inputs, expected" ,
202202 [
203- # Test when only a home config file exists (no local config file),
204- # expect to return args if wavelength or anode type is specified,
205- # otherwise update args with values from the home config file.
203+ # Test with only a home config file (no local config),
204+ # expect to return values directly from args
205+ # if either wavelength or anode type is specified,
206+ # otherwise update args with values from the home config file
207+ # (wavelength=0.3, no anode type).
208+ # This test only checks loading behavior,
209+ # not value validation (which is handled by `set_wavelength`).
206210 # C1: no args, expect to update arg values from home config
207211 (["" ], {"wavelength" : 0.3 , "anode_type" : None }),
208212 # C2: wavelength provided, expect to return args unchanged
@@ -227,7 +231,7 @@ def test_load_wavelength_from_config_file_with_home_conf_file(
227231
228232 cli_inputs = ["2.5" , "data.xy" ] + inputs
229233 actual_args = get_args (cli_inputs )
230- actual_args = _load_wavelength_from_config_file (actual_args )
234+ actual_args = load_wavelength_from_config_file (actual_args )
231235 assert actual_args .wavelength == expected ["wavelength" ]
232236 assert actual_args .anode_type == expected ["anode_type" ]
233237
@@ -236,9 +240,13 @@ def test_load_wavelength_from_config_file_with_home_conf_file(
236240 "inputs, expected" ,
237241 [
238242 # Test when a local config file exists,
239- # expect to return args if wavelength or anode type is specified,
240- # otherwise update args with values from the home config file.
243+ # expect to return values directly from args
244+ # if either wavelength or anode type is specified,
245+ # otherwise update args with values from the local config file
246+ # (wavelength=0.6, no anode type).
241247 # Results should be the same whether if the home config exists.
248+ # This test only checks loading behavior,
249+ # not value validation (which is handled by `set_wavelength`).
242250 # C1: no args, expect to update arg values from local config
243251 (["" ], {"wavelength" : 0.6 , "anode_type" : None }),
244252 # C2: wavelength provided, expect to return args unchanged
@@ -266,7 +274,7 @@ def test_load_wavelength_from_config_file_with_local_conf_file(
266274
267275 cli_inputs = ["2.5" , "data.xy" ] + inputs
268276 actual_args = get_args (cli_inputs )
269- actual_args = _load_wavelength_from_config_file (actual_args )
277+ actual_args = load_wavelength_from_config_file (actual_args )
270278 assert actual_args .wavelength == expected ["wavelength" ]
271279 assert actual_args .anode_type == expected ["anode_type" ]
272280
@@ -282,6 +290,8 @@ def test_load_wavelength_from_config_file_with_local_conf_file(
282290 [
283291 # Test when no config files exist,
284292 # expect to return args without modification.
293+ # This test only checks loading behavior,
294+ # not value validation (which is handled by `set_wavelength`).
285295 # C1: no args
286296 (["" ], {"wavelength" : None , "anode_type" : None }),
287297 # C1: wavelength provided
@@ -307,7 +317,7 @@ def test_load_wavelength_from_config_file_without_conf_files(
307317
308318 cli_inputs = ["2.5" , "data.xy" ] + inputs
309319 actual_args = get_args (cli_inputs )
310- actual_args = _load_wavelength_from_config_file (actual_args )
320+ actual_args = load_wavelength_from_config_file (actual_args )
311321 assert actual_args .wavelength == expected ["wavelength" ]
312322 assert actual_args .anode_type == expected ["anode_type" ]
313323
0 commit comments