Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
robjmcgibbon committed Oct 8, 2024
1 parent abd4ed5 commit a7290f8
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -53,15 +53,27 @@ 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)
data.gas.temperatures.convert_to_units(K)

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):
Expand Down

0 comments on commit a7290f8

Please sign in to comment.