From d23fa77e4371af59cc807d5cd92db532ce37810d Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Sun, 27 Oct 2024 21:21:49 +0200 Subject: [PATCH] Tests: converter.add_bond_order_to_s_mol() --- arc/species/converter_test.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arc/species/converter_test.py b/arc/species/converter_test.py index 531bd07a7f..62b6c89ed6 100644 --- a/arc/species/converter_test.py +++ b/arc/species/converter_test.py @@ -4236,6 +4236,16 @@ def test_order_atoms(self): if index1 < index2: self.assertIn(index2, bond_dict[index1]) # check that these atoms are connected in all mols + def test_add_bond_order_to_s_mol(self): + """Test the add_bond_order_to_s_mol function""" + c2h5no2_bo = ARCSpecies(label='C2H5NO2', smiles='CC[N+](=O)[O-]') + c2h5no2_s = converter.update_molecule(mol=c2h5no2_bo.mol, to_single_bonds=True) + c2h5no2_bo_from_s = converter.add_bond_order_to_s_mol(s_mol=c2h5no2_s, bo_mol=c2h5no2_bo.mol) + smiles = c2h5no2_bo_from_s.copy(deep=True).to_smiles() + self.assertIn('[N+]', smiles) + self.assertIn('[O-]', smiles) + self.assertIn('=O', smiles) + def test_is_isomorphic(self): """Test the RMG is_isomorphic method""" mol1 = converter.s_bonds_mol_from_xyz(self.xyz1['dict'])