From 1f76c6a487a6c47b88100bb582ad58d0cd74f5e0 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Fri, 2 Aug 2024 14:50:19 -0700 Subject: [PATCH] sensor_TEST.py: move PreUpdate callback to Update The test's PreUpdate callback assumes that it executes after the ForceTorque::PreUpdate, so just move it to Update to gurantee it. Also fix a spelling error in the callback variable names. Signed-off-by: Steve Peters --- python/test/sensor_TEST.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/python/test/sensor_TEST.py b/python/test/sensor_TEST.py index aba4c61ca9..156459e11e 100755 --- a/python/test/sensor_TEST.py +++ b/python/test/sensor_TEST.py @@ -36,8 +36,8 @@ def test_model(self): def on_post_udpate_cb(_info, _ecm): self.post_iterations += 1 - def on_pre_udpate_cb(_info, _ecm): - self.pre_iterations += 1 + def on_update_cb(_info, _ecm): + self.iterations += 1 world_e = world_entity(_ecm) self.assertNotEqual(K_NULL_ENTITY, world_e) w = World(world_e) @@ -53,19 +53,19 @@ def on_pre_udpate_cb(_info, _ecm): # Pose Test self.assertEqual(Pose3d(0, 1, 0, 0, 0, 0), sensor.pose(_ecm)) # Topic Test - if self.pre_iterations <= 1: + if self.iterations <= 1: self.assertEqual(None, sensor.topic(_ecm)) else: self.assertEqual('sensor_topic_test', sensor.topic(_ecm)) # Parent Test self.assertEqual(j.entity(), sensor.parent(_ecm)) - def on_udpate_cb(_info, _ecm): - self.iterations += 1 + def on_pre_update_cb(_info, _ecm): + self.pre_iterations += 1 fixture.on_post_update(on_post_udpate_cb) - fixture.on_update(on_udpate_cb) - fixture.on_pre_update(on_pre_udpate_cb) + fixture.on_update(on_update_cb) + fixture.on_pre_update(on_pre_update_cb) fixture.finalize() server = fixture.server()