From d676a05c3d7df5fa5d6b060c17d0e31fb8748209 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Mon, 28 Oct 2024 10:44:00 +0200 Subject: [PATCH] Tests: common.remove_numeric_parentheses() --- tests/test_common.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_common.py b/tests/test_common.py index 871a0951..4638fd4d 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -171,3 +171,13 @@ def test_get_o2_stoichiometry(): assert common.get_o2_stoichiometry(smiles='CCCCCC') == 9.5 # 6 CO2 + 7 H2O assert common.get_o2_stoichiometry(smiles='CCO') == 3 # 2 CO2 + 3 H2O - O assert common.get_o2_stoichiometry(smiles='NCC') == 7.5 / 2 # 2 CO2 + 3.5 H2O + + +def test_remove_numeric_parentheses(): + """Test the remove_numeric_parentheses() function""" + assert common.remove_numeric_parentheses('C2H5(2)') == 'C2H5' + assert common.remove_numeric_parentheses('C2H5') == 'C2H5' + assert common.remove_numeric_parentheses('CH2(S)') == 'CH2(S)' + assert common.remove_numeric_parentheses('C2H5(547)') == 'C2H5' + assert common.remove_numeric_parentheses('C2H5(547)H') == 'C2H5(547)H' +