Skip to content

Commit ee7c31e

Browse files
committed
Added resonance paths tests
to lone pair <=> radical and lone pair <=> multiple bond
1 parent 559a686 commit ee7c31e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

rmgpy/molecule/resonanceTest.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,26 @@ def testOxime(self):
4848
self.assertEqual(len(molList), 3)
4949
self.assertTrue(any([any([atom.charge != 0 for atom in mol.vertices]) for mol in molList]))
5050

51+
def testN2H3(self):
52+
"""Test resonance structure generation for N[NH] radical
53+
Tests lone pair <=> radical resonance involving nitrogen with two lone pairs,
54+
as well as formation of double and triple bonds"""
55+
molList = generateResonanceStructures(Molecule(SMILES="N[NH]"))
56+
self.assertEqual(len(molList), 5)
57+
58+
def testHOS(self):
59+
"""Test resonance structure generation for O[S] radical
60+
Tests lone pair <=> radical resonance involving sulfur and oxigen with just one lone pair,
61+
as well as formation of a double bond"""
62+
molList = generateResonanceStructures(Molecule(SMILES="O[S]"))
63+
self.assertEqual(len(molList), 3)
64+
65+
def testHSO3(self):
66+
"""Test resonance structure generation for OS(=O)[O] radical
67+
A very interesting case for resonance involving sulfur with many possible combinations"""
68+
molList = generateResonanceStructures(Molecule(SMILES="OS(=O)[O]"))
69+
self.assertEqual(len(molList), 21)
70+
5171
def testAzide(self):
5272
"""Test resonance structure generation for ethyl azide
5373

0 commit comments

Comments
 (0)