Skip to content

Commit

Permalink
Added Docstrings for the validation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DhruvSondhi committed May 3, 2021
1 parent 3832d91 commit 1cb311b
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions tardis/io/tests/test_config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,21 @@ def test_config_hdf(hdf_file_path, tardis_config_verysimple):


def test_model_section_config(tardis_config_verysimple):
"""
Configuration Validation Test for Model Section of the Tardis Config YAML File
Validates:
Density: branch85_w7
Velocity (Start < End)
Parameter
---------
`tardis_config_verysimple` : YAML File
Result
------
Assertion based on validation for specified values
"""
conf = Configuration.from_config_dict(
tardis_config_verysimple, validate=True, config_dirname="test"
)
Expand All @@ -96,6 +111,21 @@ def test_model_section_config(tardis_config_verysimple):


def test_supernova_section_config(tardis_config_verysimple):
"""
Configuration Validation Test for Supernova Section of the Tardis Config YAML File
Validates:
Time of Explosion (Must always be positive)
Luminosity Wavelength Limits (Start < End)
Parameter
---------
`tardis_config_verysimple` : YAML File
Result
------
Assertion based on validation for specified values
"""
conf = Configuration.from_config_dict(
tardis_config_verysimple, validate=True, config_dirname="test"
)
Expand Down Expand Up @@ -123,6 +153,21 @@ def test_supernova_section_config(tardis_config_verysimple):


def test_plasma_section_config(tardis_config_verysimple):
"""
Configuration Validation Test for Plasma Section of the Tardis Config YAML File
Validates:
Initial temperature inner (must be greater than -1K)
Initial radiative temperature (must be greater than -1K)
Parameter
---------
`tardis_config_verysimple` : YAML File
Result
------
Assertion based on validation for specified values
"""
conf = Configuration.from_config_dict(
tardis_config_verysimple, validate=True, config_dirname="test"
)
Expand All @@ -137,6 +182,20 @@ def test_plasma_section_config(tardis_config_verysimple):


def test_spectrum_section_config(tardis_config_verysimple):
"""
Configuration Validation Test for Plasma Section of the Tardis Config YAML File
Validates:
Spectrum Start & End Limits (Start < End)
Parameter
---------
`tardis_config_verysimple` : YAML File
Result
------
Assertion based on validation for specified values
"""
conf = Configuration.from_config_dict(
tardis_config_verysimple, validate=True, config_dirname="test"
)
Expand Down

0 comments on commit 1cb311b

Please sign in to comment.