Verified Commit 7fbe6397 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test/python: add test Model

parent c4eb44c7
SET(${PROJECT_NAME}_PYTHON_TESTS
bindings
bindings_model
bindings_data
bindings_com
bindings_com_velocity_derivatives
......
import unittest
import pinocchio as pin
pin.switchToNumpyMatrix()
from test_case import TestCase
class TestModel(TestCase):
def setUp(self):
self.model = pin.buildSampleModelHumanoidRandom()
def test_pickle(self):
import pickle
model = self.model
pickle.dump(model, open( "save.p", "wb" ) )
model_copy = pickle.load( open( "save.p", "rb" ) )
self.assertTrue(model == model_copy)
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