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

Commit

Permalink
add an unittest for fragment clar structure generation
Browse files Browse the repository at this point in the history
  • Loading branch information
KEHANG committed May 15, 2018
1 parent ef56821 commit 875a172
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion test/fragment_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def test_getAromaticRings(self):
self.assertEqual(aromaticRing_atomSet, expected_aromaticRing_atomSet)
self.assertEqual(aromaticBonds_set, expected_aromaticBonds_set)

def test_generate_resonance_structures(self):
def test_generate_resonance_structures1(self):

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

self.assertEqual(len(frag_res), 3)

def test_generate_resonance_structures2(self):

adj = """1 C u0 p0 c0 {2,D} {10,S} {11,S}
2 C u0 p0 c0 {1,D} {3,S} {12,S}
3 C u0 p0 c0 {2,S} {4,D} {13,S}
4 C u0 p0 c0 {3,D} {5,S} {9,S}
5 C u0 p0 c0 {4,S} {6,D} {14,S}
6 C u0 p0 c0 {5,D} {7,S} {15,S}
7 C u0 p0 c0 {6,S} {8,D} {16,S}
8 C u0 p0 c0 {7,D} {9,S} {17,S}
9 C u0 p0 c0 {4,S} {8,S} {10,D}
10 C u0 p0 c0 {1,S} {9,D} {18,S}
11 H u0 p0 c0 {1,S}
12 H u0 p0 c0 {2,S}
13 H u0 p0 c0 {3,S}
14 H u0 p0 c0 {5,S}
15 H u0 p0 c0 {6,S}
16 H u0 p0 c0 {7,S}
17 H u0 p0 c0 {8,S}
18 H u0 p0 c0 {10,S}
"""
fragment = afm.fragment.Fragment().fromAdjacencyList(adj)

frag_res = resonance.generate_resonance_structures(fragment,
clarStructures=True)

self.assertEqual(len(frag_res), 3)

0 comments on commit 875a172

Please sign in to comment.