From a7290f87ab83ee4db6e7ea7f7595c842a1efe0f9 Mon Sep 17 00:00:00 2001 From: robjmcgibbon Date: Tue, 8 Oct 2024 12:48:03 +0200 Subject: [PATCH] Add test --- tests/test_data.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/test_data.py b/tests/test_data.py index 1cc32d3e..c6ce8055 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -12,7 +12,7 @@ import h5py -from unyt import K +from unyt import K, Msun from numpy import logical_and, isclose, float64 from numpy import array as numpy_array @@ -53,8 +53,8 @@ def test_time_metadata(filename): @requires("cosmological_volume.hdf5") def test_temperature_units(filename): """ - This tests checks if we correctly read in temperature units. Based on a past bug, to make - sure we never break this again. + This tests checks if we correctly read in temperature units. Based + on a past bug, to make sure we never break this again. """ data = load(filename) @@ -62,6 +62,18 @@ def test_temperature_units(filename): return +@requires("cosmological_volume.hdf5") +def test_initial_mass_table(filename): + """ + This tests checks if we correctly read in the initial mass table. Based + on a past bug, to make sure we never break this again. + """ + + data = load(filename) + data.metadata.initial_mass_table.gas.convert_to_units(Msun) + + return + @requires("cosmological_volume.hdf5") def test_units(filename):