Skip to content

Commit

Permalink
Merge pull request #1853 from jcarpent/topic/python
Browse files Browse the repository at this point in the history
Enforce testing of Python bindings
  • Loading branch information
jcarpent authored Feb 1, 2023
2 parents 990212b + 00153d0 commit a928f6d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions unittest/python/bindings_SE3.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,11 @@ def compute (m):
M_from_h = pin.SE3(h)
self.assertTrue(M == M_from_h)

def test_several_init(self):
for _ in range(1000000):
r = pin.SE3.Random() * pin.SE3.Random()
s = r.__str__()
self.assertTrue(s != '')

if __name__ == '__main__':
unittest.main()
5 changes: 5 additions & 0 deletions unittest/python/bindings_force.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,10 @@ def test_conversion(self):

self.assertTrue(f_from_array == f)

def test_several_init(self):
for _ in range(1000000):
f = pin.Force.Zero() + pin.Force.Zero()
self.assertTrue(np.allclose(f.vector, zero(6)))

if __name__ == '__main__':
unittest.main()
6 changes: 6 additions & 0 deletions unittest/python/bindings_inertia.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,11 @@ def test_array(self):

self.assertApprox(I_array,I.matrix())

def test_several_init(self):
for _ in range(1000000):
i = pin.Inertia.Random() + pin.Inertia.Random()
s = i.__str__()
self.assertTrue(s != '')

if __name__ == '__main__':
unittest.main()
5 changes: 5 additions & 0 deletions unittest/python/bindings_motion.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,10 @@ def test_conversion(self):

self.assertTrue(m_from_array == m)

def test_several_init(self):
for _ in range(1000000):
v = pin.Motion.Zero() + pin.Motion.Zero()
self.assertTrue(np.allclose(v.vector, zero(6)))

if __name__ == '__main__':
unittest.main()

0 comments on commit a928f6d

Please sign in to comment.