@@ -198,9 +198,52 @@ def test_set_output_directory_bad(user_filesystem):
198198@pytest .mark .parametrize (
199199 "inputs, expected" ,
200200 [
201+ # C1: nothing passed in, expect default is Mo
201202 ([], {"wavelength" : 0.71073 , "anode_type" : "Mo" }),
202- (["--anode-type" , "Ag" ], {"wavelength" : 0.59 , "anode_type" : "Ag" }),
203+ # C2: only a valid anode type was entered (case independent),
204+ # expect to match the corresponding wavelength
205+ # and preserve the correct case anode type
206+ (["--anode-type" , "Mo" ], {"wavelength" : 0.71073 , "anode_type" : "Mo" }),
207+ (
208+ ["--anode-type" , "MoKa1" ],
209+ {"wavelength" : 0.70930 , "anode_type" : "MoKa1" },
210+ ),
211+ (
212+ ["--anode-type" , "MoKa1Ka2" ],
213+ {"wavelength" : 0.71073 , "anode_type" : "MoKa1Ka2" },
214+ ),
215+ (["--anode-type" , "Ag" ], {"wavelength" : 0.56087 , "anode_type" : "Ag" }),
216+ (
217+ ["--anode-type" , "AgKa1" ],
218+ {"wavelength" : 0.55941 , "anode_type" : "AgKa1" },
219+ ),
220+ (
221+ ["--anode-type" , "AgKa1Ka2" ],
222+ {"wavelength" : 0.56087 , "anode_type" : "AgKa1Ka2" },
223+ ),
224+ (["--anode-type" , "Cu" ], {"wavelength" : 1.54184 , "anode_type" : "Cu" }),
225+ (
226+ ["--anode-type" , "CuKa1" ],
227+ {"wavelength" : 1.54056 , "anode_type" : "CuKa1" },
228+ ),
229+ (
230+ ["--anode-type" , "CuKa1Ka2" ],
231+ {"wavelength" : 1.54184 , "anode_type" : "CuKa1Ka2" },
232+ ),
233+ (
234+ ["--anode-type" , "moKa1Ka2" ],
235+ {"wavelength" : 0.71073 , "anode_type" : "MoKa1Ka2" },
236+ ),
237+ (["--anode-type" , "ag" ], {"wavelength" : 0.56087 , "anode_type" : "Ag" }),
238+ (
239+ ["--anode-type" , "cuka1" ],
240+ {"wavelength" : 1.54056 , "anode_type" : "CuKa1" },
241+ ),
242+ # C3: only a valid wavelength was entered,
243+ # expect to include the wavelength only and anode type is None
203244 (["--wavelength" , "0.25" ], {"wavelength" : 0.25 , "anode_type" : None }),
245+ # C4: both valid anode type and wavelength were entered,
246+ # expect to remove the anode type and preserve wavelength only
204247 (
205248 ["--wavelength" , "0.25" , "--anode-type" , "Ag" ],
206249 {"wavelength" : 0.25 , "anode_type" : None },
0 commit comments