@@ -167,35 +167,11 @@ def test_get_package_info(monkeypatch, inputs, expected):
167167 assert actual_metadata == expected
168168
169169
170- @pytest .mark .parametrize (
171- "inputs, expected_mu" ,
172- [
173- # Test whether the function returns the correct mu
174- ( # C1: Composition, energy, and mass density provided, expect to get mu based on mass density
175- # 1. Fully dense mass density
176- {"sample_composition" : "quartz" , "energy" : 10 , "sample_mass_density" : 2.65 },
177- 5.0368 ,
178- ),
179- ( # 2. Measured mass density
180- {
181- "sample_composition" : "ZrO2" ,
182- "energy" : 17.445 ,
183- "sample_mass_density" : 1.009 ,
184- },
185- 1.2522 ,
186- ),
187- ],
188- )
189- def test_compute_mu_using_xraydb (inputs , expected_mu ):
190- actual_mu = compute_mu_using_xraydb (** inputs )
191- assert actual_mu == pytest .approx (expected_mu , rel = 1e-6 , abs = 1e-4 )
192-
193-
194170@pytest .mark .parametrize (
195171 "inputs" ,
196172 [
197- # Test when the function raises ValueError
198- # C1: Both mass density and packing fraction are provided
173+ # Test when the function has invalid inputs
174+ # C1: Both mass density and packing fraction are provided, expect ValueError exception
199175 (
200176 {
201177 "sample_composition" : "quartz" ,
@@ -204,7 +180,7 @@ def test_compute_mu_using_xraydb(inputs, expected_mu):
204180 "packing_fraction" : 1 ,
205181 }
206182 ),
207- # C2: None of mass density or packing fraction are provided
183+ # C2: None of mass density or packing fraction are provided, expect ValueError exception
208184 (
209185 {
210186 "sample_composition" : "quartz" ,
0 commit comments