Go to the documentation of this file.00001
00002 import unittest
00003 from controller_manager import controller_manager_interface
00004
00005
00006 class TestUtils(unittest.TestCase):
00007 def test_scripts(self):
00008
00009
00010 self.assertTrue(controller_manager_interface.load_controller('my_controller1'))
00011
00012
00013 self.assertFalse(controller_manager_interface.load_controller('non_existent_controller'))
00014
00015
00016 self.assertTrue(controller_manager_interface.start_controller('my_controller1'))
00017
00018
00019 self.assertFalse(controller_manager_interface.start_controller('my_controller3'))
00020
00021
00022 self.assertTrue(controller_manager_interface.stop_controller('my_controller1'))
00023
00024
00025 self.assertTrue(controller_manager_interface.load_controller('my_controller3'))
00026
00027
00028 self.assertTrue(controller_manager_interface.start_controllers(('my_controller1', 'my_controller3')))
00029
00030
00031 self.assertTrue(controller_manager_interface.stop_controllers(('my_controller1', 'my_controller3')))
00032
00033
00034 self.assertTrue(controller_manager_interface.reload_libraries(force_kill=True, restore=True))
00035
00036
00037 self.assertTrue(controller_manager_interface.unload_controller('my_controller1'))
00038
00039 self.assertTrue(controller_manager_interface.unload_controller('my_controller3'))
00040
00041
00042 self.assertTrue(controller_manager_interface.load_controller('my_controller1'))
00043
00044
00045 self.assertFalse(controller_manager_interface.reload_libraries(force_kill=False, restore=True))
00046
00047
00048 self.assertTrue(controller_manager_interface.reload_libraries(force_kill=True, restore=False))
00049
00050
00051 self.assertTrue(controller_manager_interface.reload_libraries(force_kill=False, restore=False))
00052
00053
00054 if __name__ == '__main__':
00055 import rostest
00056 rostest.rosrun('controller_manager_msgs',
00057 'controller_manager_scripts_rostest',
00058 TestUtils)