From 9196df455385ec9132138003a1ede95a50f80371 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Tue, 28 Nov 2023 09:47:51 +0200 Subject: [PATCH] Tests: test_count_species_in_well --- tests/test_flux.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_flux.py b/tests/test_flux.py index 023be4c0..732bcc0c 100644 --- a/tests/test_flux.py +++ b/tests/test_flux.py @@ -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."""