@@ -115,7 +115,7 @@ def test_set_input_lists(inputs, expected, user_filesystem):
115115 base_dir .resolve () / expected_path for expected_path in expected
116116 ]
117117
118- cli_inputs = inputs + ["--mud" , "2.5" ]
118+ cli_inputs = [ "applymud" ] + inputs + ["--mud" , "2.5" ]
119119 actual_args = get_args (cli_inputs )
120120 actual_args = set_input_lists (actual_args )
121121 assert sorted (actual_args .input_paths ) == sorted (expected_paths )
@@ -161,7 +161,7 @@ def test_set_input_lists(inputs, expected, user_filesystem):
161161def test_set_input_files_bad (inputs , expected_error_msg , user_filesystem ):
162162 base_dir = Path (user_filesystem )
163163 os .chdir (base_dir )
164- cli_inputs = inputs + ["--mud" , "2.5" ]
164+ cli_inputs = [ "applymud" ] + inputs + ["--mud" , "2.5" ]
165165 actual_args = get_args (cli_inputs )
166166 with pytest .raises (FileNotFoundError , match = re .escape (expected_error_msg )):
167167 actual_args = set_input_lists (actual_args )
@@ -179,7 +179,7 @@ def test_set_input_files_bad(inputs, expected_error_msg, user_filesystem):
179179def test_set_output_directory (inputs , expected , user_filesystem ):
180180 os .chdir (user_filesystem )
181181 expected_output_directory = Path (user_filesystem ) / expected [0 ]
182- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
182+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
183183 actual_args = get_args (cli_inputs )
184184 actual_args = set_output_directory (actual_args )
185185 assert actual_args .output_directory == expected_output_directory
@@ -190,6 +190,7 @@ def test_set_output_directory(inputs, expected, user_filesystem):
190190def test_set_output_directory_bad (user_filesystem ):
191191 os .chdir (user_filesystem )
192192 cli_inputs = [
193+ "applymud" ,
193194 "data.xy" ,
194195 "--mud" ,
195196 "2.5" ,
@@ -235,7 +236,7 @@ def test_load_wavelength_from_config_file_with_home_conf_file(
235236 mocker .patch ("pathlib.Path.home" , lambda _ : home_dir )
236237 os .chdir (cwd )
237238
238- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
239+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
239240 actual_args = get_args (cli_inputs )
240241 actual_args = load_wavelength_from_config_file (actual_args )
241242 assert actual_args .wavelength == expected ["wavelength" ]
@@ -278,7 +279,7 @@ def test_load_wavelength_from_config_file_with_local_conf_file(
278279 with open (cwd / "diffpyconfig.json" , "w" ) as f :
279280 json .dump (local_config_data , f )
280281
281- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
282+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
282283 actual_args = get_args (cli_inputs )
283284 actual_args = load_wavelength_from_config_file (actual_args )
284285 assert actual_args .wavelength == expected ["wavelength" ]
@@ -321,7 +322,7 @@ def test_load_wavelength_from_config_file_without_conf_files(
321322 confile = home_dir / "diffpyconfig.json"
322323 os .remove (confile )
323324
324- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
325+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
325326 actual_args = get_args (cli_inputs )
326327 actual_args = load_wavelength_from_config_file (actual_args )
327328 assert actual_args .wavelength == expected ["wavelength" ]
@@ -380,7 +381,7 @@ def test_load_wavelength_from_config_file_without_conf_files(
380381 ],
381382)
382383def test_set_wavelength (inputs , expected ):
383- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
384+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
384385 actual_args = get_args (cli_inputs )
385386 actual_args = set_wavelength (actual_args )
386387 assert actual_args .wavelength == expected ["wavelength" ]
@@ -419,7 +420,7 @@ def test_set_wavelength(inputs, expected):
419420 ],
420421)
421422def test_set_wavelength_bad (inputs , expected_error_msg ):
422- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
423+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
423424 actual_args = get_args (cli_inputs )
424425 with pytest .raises (ValueError , match = re .escape (expected_error_msg )):
425426 actual_args = set_wavelength (actual_args )
@@ -435,14 +436,14 @@ def test_set_wavelength_bad(inputs, expected_error_msg):
435436 ],
436437)
437438def test_set_xtype (inputs , expected_xtype ):
438- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
439+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
439440 actual_args = get_args (cli_inputs )
440441 actual_args = set_xtype (actual_args )
441442 assert actual_args .xtype == expected_xtype
442443
443444
444445def test_set_xtype_bad ():
445- cli_inputs = ["data.xy" , "--mud" , "2.5" , "--xtype" , "invalid" ]
446+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" , "--xtype" , "invalid" ]
446447 actual_args = get_args (cli_inputs )
447448 with pytest .raises (
448449 ValueError ,
@@ -474,7 +475,7 @@ def test_set_xtype_bad():
474475def test_set_mud (user_filesystem , inputs , expected_mud ):
475476 cwd = Path (user_filesystem )
476477 os .chdir (cwd )
477- cli_inputs = ["data.xy" ] + inputs
478+ cli_inputs = ["applymud" , " data.xy" ] + inputs
478479 actual_args = get_args (cli_inputs )
479480 actual_args = set_mud (actual_args )
480481 assert actual_args .mud == pytest .approx (expected_mud , rel = 1e-4 , abs = 0.1 )
@@ -550,7 +551,7 @@ def test_set_mud_bad(user_filesystem, inputs, expected):
550551 expected_error , expected_error_msg = expected
551552 cwd = Path (user_filesystem )
552553 os .chdir (cwd )
553- cli_inputs = ["data.xy" ] + inputs
554+ cli_inputs = ["applymud" , " data.xy" ] + inputs
554555 actual_args = get_args (cli_inputs )
555556 with pytest .raises (expected_error , match = re .escape (expected_error_msg )):
556557 actual_args = set_mud (actual_args )
@@ -577,12 +578,12 @@ def test_set_mud_bad(user_filesystem, inputs, expected):
577578 ],
578579)
579580def test_load_user_metadata (inputs , expected ):
580- expected_args = get_args (["data.xy" , "--mud" , "2.5" ])
581+ expected_args = get_args (["applymud" , " data.xy" , "--mud" , "2.5" ])
581582 for expected_pair in expected :
582583 setattr (expected_args , expected_pair [0 ], expected_pair [1 ])
583584 delattr (expected_args , "user_metadata" )
584585
585- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
586+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
586587 actual_args = get_args (cli_inputs )
587588 actual_args = load_user_metadata (actual_args )
588589 assert actual_args == expected_args
@@ -618,7 +619,7 @@ def test_load_user_metadata(inputs, expected):
618619 ],
619620)
620621def test_load_user_metadata_bad (inputs , expected_error_msg ):
621- cli_inputs = ["data.xy" , "--mud" , "2.5" ] + inputs
622+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ] + inputs
622623 actual_args = get_args (cli_inputs )
623624 with pytest .raises (ValueError , match = re .escape (expected_error_msg )):
624625 actual_args = load_user_metadata (actual_args )
@@ -681,6 +682,7 @@ def test_load_user_info(monkeypatch, inputs, expected, user_filesystem):
681682 os .chdir (cwd )
682683
683684 cli_inputs = [
685+ "applymud" ,
684686 "data.xy" ,
685687 "--mud" ,
686688 "2.5" ,
@@ -705,7 +707,7 @@ def test_load_package_info(mocker):
705707 "3.3.0" if package_name == "diffpy.utils" else "1.2.3"
706708 ),
707709 )
708- cli_inputs = ["data.xy" , "--mud" , "2.5" ]
710+ cli_inputs = ["applymud" , " data.xy" , "--mud" , "2.5" ]
709711 actual_args = get_args (cli_inputs )
710712 actual_args = load_package_info (actual_args )
711713 assert actual_args .package_info == {
@@ -731,6 +733,7 @@ def test_load_metadata(mocker, user_filesystem):
731733 ),
732734 )
733735 cli_inputs = [
736+ "applymud" ,
734737 "." ,
735738 "--mud" ,
736739 "2.5" ,
0 commit comments