From 5fe6576a9cba1679c491344efa250133eafec5a5 Mon Sep 17 00:00:00 2001 From: =shimwell Date: Tue, 24 Mar 2020 11:57:17 +0000 Subject: [PATCH] added test to check decimal values fail --- tests/unit_tests/test_material.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit_tests/test_material.py b/tests/unit_tests/test_material.py index 7153fded5a..43aeb62789 100644 --- a/tests/unit_tests/test_material.py +++ b/tests/unit_tests/test_material.py @@ -92,6 +92,11 @@ def test_adding_elements_by_formula(): for nuclide in ref_dens: assert nuc_dens[nuclide][1] == pytest.approx(ref_dens[nuclide], 1e-2) + # testing non integer multiplier results in a value error + m = openmc.Material() + with pytest.raises(ValueError): + m.add_elements_from_formula('Li4.2SiO4') + # testing lowercase elements results in a value error m = openmc.Material() with pytest.raises(ValueError):