Skip to content

Commit a325809

Browse files
committed
Test for ccp4_contact.py
1 parent 39bb271 commit a325809

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/ccp4_contact.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
AUTHOR
2424
Gerhard Reitmayr and Dalia Daujotyte, 2011.
2525
'''
26+
from pathlib import Path
2627
from pymol import cmd
2728
import re
2829

@@ -73,3 +74,14 @@ def ccp4_contact(contactsfile, selName1="source", selName2="target"):
7374
cmd.select(selName2 + "_atom", atomSel)
7475

7576
cmd.extend("ccp4_contact", ccp4_contact)
77+
78+
79+
def test_ccp4_contact():
80+
datadir = Path(__file__).parents[1] / "files_for_examples"
81+
cmd.reinitialize()
82+
cmd.fab("PCQAFSISGKQKGFEDSRGTL", chain="A", resi=80)
83+
ccp4_contact(f"{datadir}/2c7r.contact", selName1="sel1", selName2="sel2")
84+
assert cmd.count_atoms("sel1_res") == 128
85+
assert cmd.count_atoms("sel1_atom") == 20
86+
assert cmd.count_atoms("sel2_res") == 128
87+
assert cmd.count_atoms("sel2_atom") == 20

0 commit comments

Comments
 (0)