Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
e5762fb2
Commit
e5762fb2
authored
Oct 26, 2015
by
John Chodera (MSKCC)
Browse files
Added Python test for Topology getters.
parent
73cfcd68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
wrappers/python/tests/TestTopology.py
wrappers/python/tests/TestTopology.py
+30
-0
No files found.
wrappers/python/tests/TestTopology.py
0 → 100644
View file @
e5762fb2
import
sys
import
unittest
from
simtk.openmm.app
import
*
from
simtk.openmm
import
*
from
simtk.unit
import
*
import
simtk.openmm.app.element
as
elem
if
sys
.
version_info
>=
(
3
,
0
):
from
io
import
StringIO
else
:
from
cStringIO
import
StringIO
class
TestTopology
(
unittest
.
TestCase
):
"""Test the Topology object"""
def
check_pdbfile
(
self
,
pdbfilename
,
natoms
,
nres
,
nchains
):
"""Check that a PDB file has the specified number of atoms, residues, and chains."""
pdb
=
PDBFile
(
pdbfilename
)
top
=
pdb
.
topology
self
.
assertEqual
(
pdb
.
topology
.
getNumAtoms
(),
natoms
)
self
.
assertEqual
(
pdb
.
topology
.
getNumResidues
(),
nres
)
self
.
assertEqual
(
pdb
.
topology
.
getNumChains
(),
nchains
)
def
test_getters
(
self
):
"""Test getters for number of atoms, residues, chains."""
check_pdbfile
(
'systems/1T2Y.pdb'
,
271
,
25
,
1
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment