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
2b66a71b
Commit
2b66a71b
authored
Oct 26, 2015
by
John Chodera (MSKCC)
Browse files
Compare contents of deepcopy Force objects in Python tests.
parent
a1372d52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
wrappers/python/tests/TestPickle.py
wrappers/python/tests/TestPickle.py
+5
-1
No files found.
wrappers/python/tests/TestPickle.py
View file @
2b66a71b
...
...
@@ -3,6 +3,7 @@ from validateConstraints import *
from
simtk.openmm.app
import
*
from
simtk.openmm
import
*
from
simtk.unit
import
*
import
simtk.openmm
import
simtk.openmm.app.element
as
elem
import
simtk.openmm.app.forcefield
as
forcefield
import
copy
...
...
@@ -32,6 +33,8 @@ class TestPickle(unittest.TestCase):
force_copy
=
copy
.
deepcopy
(
force
)
# Check class name is same.
self
.
assertEqual
(
force
.
__class__
.
__name__
,
force_copy
.
__class__
.
__name__
)
# Check Force object contents are the same.
self
.
assertEqual
(
XmlSerializer
.
serialize
(
force
),
XmlSerializer
.
serialize
(
force_copy
))
def
test_deepcopy
(
self
):
"""Test that serialization/deserialization works (via deepcopy)."""
...
...
@@ -60,7 +63,8 @@ class TestPickle(unittest.TestCase):
force_copy
=
copy
.
deepcopy
(
force
)
# Check class name is same.
self
.
assertEqual
(
force
.
__class__
.
__name__
,
force_copy
.
__class__
.
__name__
)
# TODO: Check to make sure all force data properly copied?
# Check Force object contents are the same.
self
.
assertEqual
(
XmlSerializer
.
serialize
(
force
),
XmlSerializer
.
serialize
(
force_copy
))
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