Skip to content

Commit

Permalink
Tests: test_count_species_in_well
Browse files Browse the repository at this point in the history
  • Loading branch information
alongd committed Nov 28, 2023
1 parent 8c0ab52 commit 9196df4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,21 @@ def test_get_opposite_rxn_species():
assert flux.get_opposite_rxn_species(rxn=rxn, spc='H(3)') == ['H2O2(18)']
assert flux.get_opposite_rxn_species(rxn=rxn, spc='H2O2(18)') == ['H(3)', 'HO2(6)']

rxn = 'HO2 + NO <=> NO2 + OH'
assert flux.get_opposite_rxn_species(rxn=rxn, spc='HO2') == ['NO2', 'OH']
assert flux.get_opposite_rxn_species(rxn=rxn, spc='NO') == ['NO2', 'OH']
assert flux.get_opposite_rxn_species(rxn=rxn, spc='NO2') == ['HO2', 'NO']
assert flux.get_opposite_rxn_species(rxn=rxn, spc='OH') == ['HO2', 'NO']


def test_count_species_in_well():
"""Test counting a species in a well"""
assert flux.count_species_in_well(well='H2O + H + H', spc='H2O') == 1
assert flux.count_species_in_well(well='H2O + H + H', spc='H') == 2
assert flux.count_species_in_well(well='H2O + H + H', spc='H2') == 0
assert flux.count_species_in_well(well='HO2 + NO', spc='NO') == 1
assert flux.count_species_in_well(well='NO2 + OH', spc='NO') == 0


def test_get_other_reactants_and_products():
"""Test getting the reactants and products other than a given species."""
Expand Down

0 comments on commit 9196df4

Please sign in to comment.