Skip to content
This repository was archived by the owner on Jun 7, 2024. It is now read-only.

Commit 875a172

Browse files
committed
add an unittest for fragment clar structure generation
1 parent ef56821 commit 875a172

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

test/fragment_test.py

+29-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def test_getAromaticRings(self):
628628
self.assertEqual(aromaticRing_atomSet, expected_aromaticRing_atomSet)
629629
self.assertEqual(aromaticBonds_set, expected_aromaticBonds_set)
630630

631-
def test_generate_resonance_structures(self):
631+
def test_generate_resonance_structures1(self):
632632

633633
adj = """1 C u0 p0 c0 {2,S} {3,S} {11,S} {12,S}
634634
2 C u0 p0 c0 {1,S} {4,S} {13,S} {14,S}
@@ -660,3 +660,31 @@ def test_generate_resonance_structures(self):
660660
clarStructures=False)
661661

662662
self.assertEqual(len(frag_res), 3)
663+
664+
def test_generate_resonance_structures2(self):
665+
666+
adj = """1 C u0 p0 c0 {2,D} {10,S} {11,S}
667+
2 C u0 p0 c0 {1,D} {3,S} {12,S}
668+
3 C u0 p0 c0 {2,S} {4,D} {13,S}
669+
4 C u0 p0 c0 {3,D} {5,S} {9,S}
670+
5 C u0 p0 c0 {4,S} {6,D} {14,S}
671+
6 C u0 p0 c0 {5,D} {7,S} {15,S}
672+
7 C u0 p0 c0 {6,S} {8,D} {16,S}
673+
8 C u0 p0 c0 {7,D} {9,S} {17,S}
674+
9 C u0 p0 c0 {4,S} {8,S} {10,D}
675+
10 C u0 p0 c0 {1,S} {9,D} {18,S}
676+
11 H u0 p0 c0 {1,S}
677+
12 H u0 p0 c0 {2,S}
678+
13 H u0 p0 c0 {3,S}
679+
14 H u0 p0 c0 {5,S}
680+
15 H u0 p0 c0 {6,S}
681+
16 H u0 p0 c0 {7,S}
682+
17 H u0 p0 c0 {8,S}
683+
18 H u0 p0 c0 {10,S}
684+
"""
685+
fragment = afm.fragment.Fragment().fromAdjacencyList(adj)
686+
687+
frag_res = resonance.generate_resonance_structures(fragment,
688+
clarStructures=True)
689+
690+
self.assertEqual(len(frag_res), 3)

0 commit comments

Comments
 (0)