22import unittest
33
44from rmgpy .species import Species
5- from rmgpy .molecule .molecule import Atom , Bond , Molecule
6- from rmgpy .molecule .element import getElement
5+ from rmgpy .molecule import resonance
76from rmgpy .molecule .atomtype import atomTypes
7+ from rmgpy .molecule .element import getElement
8+ from rmgpy .molecule .molecule import Atom , Bond , Molecule
89
910import afm .fragment
1011
@@ -627,4 +628,35 @@ def test_getAromaticRings(self):
627628 self .assertEqual (aromaticRing_atomSet , expected_aromaticRing_atomSet )
628629 self .assertEqual (aromaticBonds_set , expected_aromaticBonds_set )
629630
630-
631+ def test_generate_resonance_structures (self ):
632+
633+ adj = """1 C u0 p0 c0 {2,S} {3,S} {11,S} {12,S}
634+ 2 C u0 p0 c0 {1,S} {4,S} {13,S} {14,S}
635+ 3 C u0 p0 c0 {1,S} {5,S} {15,S} {16,S}
636+ 4 C u0 p0 c0 {2,S} {17,S} {18,S} {19,S}
637+ 5 C u0 p0 c0 {3,S} {6,S} {7,D}
638+ 6 C u0 p0 c0 {5,S} {8,D} {20,S}
639+ 7 C u1 p0 c0 {5,D} {10,S}
640+ 8 C u0 p0 c0 {6,D} {9,S} {21,S}
641+ 9 C u0 p0 c0 {8,S} {10,D} {22,S}
642+ 10 C u0 p0 c0 {7,S} {9,D} {23,S}
643+ 11 H u0 p0 c0 {1,S}
644+ 12 H u0 p0 c0 {1,S}
645+ 13 H u0 p0 c0 {2,S}
646+ 14 H u0 p0 c0 {2,S}
647+ 15 H u0 p0 c0 {3,S}
648+ 16 H u0 p0 c0 {3,S}
649+ 17 R u0 p0 c0 {4,S}
650+ 18 H u0 p0 c0 {4,S}
651+ 19 H u0 p0 c0 {4,S}
652+ 20 H u0 p0 c0 {6,S}
653+ 21 H u0 p0 c0 {8,S}
654+ 22 H u0 p0 c0 {9,S}
655+ 23 H u0 p0 c0 {10,S}
656+ """
657+ fragment = afm .fragment .Fragment ().fromAdjacencyList (adj )
658+
659+ frag_res = resonance .generate_resonance_structures (fragment ,
660+ clarStructures = False )
661+
662+ self .assertEqual (len (frag_res ), 3 )
0 commit comments