Skip to content

Commit

Permalink
f schema test
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Dec 4, 2024
1 parent 2daa1ed commit 47521d0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,16 @@ def test_rmg_species_schema():
)
assert rmg_species.concentration == (0.203, 0.502)

rmg_species = RMGSpecies(label='C3H8',
smiles='CCC',
role='fuel',
equivalence_ratios=[0.5, 1.0, 2.0],
)
assert rmg_species.label == 'C3H8'
assert rmg_species.smiles == 'CCC'
assert rmg_species.role == 'fuel'
assert rmg_species.equivalence_ratios == [0.5, 1.0, 2.0]

with pytest.raises(ValidationError):
# check that concentration is constrained to >= 0
RMGSpecies(concentration=-1)
Expand Down Expand Up @@ -364,6 +374,13 @@ def test_rmg_species_schema():
constant=True,
)

with pytest.raises(ValidationError):
# check that species defined with a fuel role without phi is invalid range cannot be constant
RMGSpecies(label='C3H8',
smiles='CCC',
role='fuel',
)


def test_rmg_reactors_schema():
"""Test creating an instance of RMGReactor"""
Expand Down

0 comments on commit 47521d0

Please sign in to comment.