Skip to content

Commit c0f3aef

Browse files
author
Oliver Scott
committed
Add more utils tests (misc).
1 parent 7b6e0bd commit c0f3aef

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

tests/utils/test_misc.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
scaffoldgraph tests.utils.test_misc
3+
"""
4+
5+
import scaffoldgraph as sg
6+
7+
from scaffoldgraph.utils import summary
8+
from . import mock_sdf
9+
10+
11+
SUMMARY_GRAPH = """Type: ScaffoldNetwork
12+
Number of molecule nodes: 2
13+
Number of scaffold nodes: 8
14+
Number of edges: 12
15+
Max hierarchy: 3
16+
Min hierarchy: 1
17+
"""
18+
19+
20+
SUMMARY_NODE = """Node c1ccccc1 has the following properties:
21+
Type: scaffold
22+
Hierarchy: 1
23+
Degree: 2
24+
Parent scaffolds:
25+
Child scaffolds: O=C1CN=C(c2ccccc2)C=CN1 O=C1CN=Cc2ccccc2N1 O=C1CN=C(c2ccccc2)c2ccccc2N1 O=C1CN=C(c2ccccc2)c2ccsc2N1
26+
Child molecules:
27+
"""
28+
29+
30+
def test_bipartite(sdf_file):
31+
network = sg.ScaffoldNetwork.from_sdf(sdf_file)
32+
assert summary(network).strip() == SUMMARY_GRAPH.strip()
33+
assert summary(network, 'c1ccccc1').strip() == SUMMARY_NODE.strip()

0 commit comments

Comments
 (0)