Commit 67878bab authored by Robert McGibbon's avatar Robert McGibbon
Browse files

Get it working

parent fe129ae2
...@@ -156,3 +156,6 @@ ...@@ -156,3 +156,6 @@
$3 = &tempC; $3 = &tempC;
} }
%typemap(out) std::string OpenMM::Context::createCheckpoint{
$result = PyBytes_FromString($1.c_str());
}
\ No newline at end of file
import unittest
import simtk.openmm as mm
class TestBytes(unittest.TestCase):
def test_createCheckpoint(self):
# check that the return value of createCheckpoint is of type bytes (non-unicode)
system = mm.System()
system.addParticle(1.0)
mm.Context(system, mm.VerletIntegrator(0))
chk = mm.Context(system, mm.VerletIntegrator(0)).createCheckpoint()
assert isinstance(chk, bytes)
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment