From 5c76492b258f05acd8363ff3ef4ab23d24206b95 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Thu, 5 Mar 2015 01:32:48 +0530 Subject: [PATCH] test function added --- tardis/tests/test_atomic.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tardis/tests/test_atomic.py b/tardis/tests/test_atomic.py index a6921a892e5..9079c4e8b81 100644 --- a/tardis/tests/test_atomic.py +++ b/tardis/tests/test_atomic.py @@ -16,6 +16,16 @@ def test_ionization_h5_readin(): hi_ionization = data['ionization_energy'][0] testing.assert_almost_equal(hi_ionization, 13.59844, decimal=4) +def test_levels_h5_readin(): + data = atomic.read_levels_data(atomic.default_atom_h5_path) + assert data['atomic_number'][4] == 14 + assert data['ion_number'][4] == 0 + assert data['level_number'][4] == 4 + si_energy = data['energy'][4] + testing.assert_almost_equal(si_energy, 1.90865, decimal=4) + assert data['g'][4] == 1 + assert data['metastable'][4] == False + def test_atom_levels(): atom_data = atomic.AtomData.from_hdf5(atomic.default_atom_h5_path)