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
a3476d23
Commit
a3476d23
authored
Aug 12, 2015
by
peastman
Browse files
Merge pull request #1086 from rmcgibbo/py3
Fix two tests for python3
parents
c2891265
920d3d4b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
20 deletions
+29
-20
wrappers/python/tests/TestGromacsTopFile.py
wrappers/python/tests/TestGromacsTopFile.py
+20
-16
wrappers/python/tests/TestPdbFile.py
wrappers/python/tests/TestPdbFile.py
+9
-4
No files found.
wrappers/python/tests/TestGromacsTopFile.py
View file @
a3476d23
...
@@ -3,8 +3,12 @@ from validateConstraints import *
...
@@ -3,8 +3,12 @@ from validateConstraints import *
from
simtk.openmm.app
import
*
from
simtk.openmm.app
import
*
from
simtk.openmm
import
*
from
simtk.openmm
import
*
from
simtk.unit
import
*
from
simtk.unit
import
*
from
simtk.openmm.app.gromacstopfile
import
_defaultGromacsIncludeDir
import
simtk.openmm.app.element
as
elem
import
simtk.openmm.app.element
as
elem
GROMACS_INCLUDE
=
_defaultGromacsIncludeDir
()
@
unittest
.
skipIf
(
not
os
.
path
.
exists
(
GROMACS_INCLUDE
),
'GROMACS is not installed'
)
class
TestGromacsTopFile
(
unittest
.
TestCase
):
class
TestGromacsTopFile
(
unittest
.
TestCase
):
"""Test the GromacsTopFile.createSystem() method."""
"""Test the GromacsTopFile.createSystem() method."""
...
...
wrappers/python/tests/TestPdbFile.py
View file @
a3476d23
import
sys
import
unittest
import
unittest
from
simtk.openmm.app
import
*
from
simtk.openmm.app
import
*
from
simtk.openmm
import
*
from
simtk.openmm
import
*
from
simtk.unit
import
*
from
simtk.unit
import
*
import
simtk.openmm.app.element
as
elem
import
simtk.openmm.app.element
as
elem
import
cStringIO
if
sys
.
version_info
>=
(
3
,
0
):
from
io
import
StringIO
else
:
from
cStringIO
import
StringIO
class
TestPdbFile
(
unittest
.
TestCase
):
class
TestPdbFile
(
unittest
.
TestCase
):
"""Test the PDB file parser"""
"""Test the PDB file parser"""
...
@@ -43,9 +48,9 @@ class TestPdbFile(unittest.TestCase):
...
@@ -43,9 +48,9 @@ class TestPdbFile(unittest.TestCase):
def
test_WriteFile
(
self
):
def
test_WriteFile
(
self
):
"""Write a file, read it back, and make sure it matches the original."""
"""Write a file, read it back, and make sure it matches the original."""
pdb1
=
PDBFile
(
'systems/triclinic.pdb'
)
pdb1
=
PDBFile
(
'systems/triclinic.pdb'
)
output
=
cStringIO
.
StringIO
()
output
=
StringIO
()
PDBFile
.
writeFile
(
pdb1
.
topology
,
pdb1
.
positions
,
output
)
PDBFile
.
writeFile
(
pdb1
.
topology
,
pdb1
.
positions
,
output
)
input
=
cStringIO
.
StringIO
(
output
.
getvalue
())
input
=
StringIO
(
output
.
getvalue
())
pdb2
=
PDBFile
(
input
)
pdb2
=
PDBFile
(
input
)
output
.
close
();
output
.
close
();
input
.
close
();
input
.
close
();
...
...
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