morse.testing package¶
Submodules¶
morse.testing.exceptions module¶
morse.testing.moos module¶
MOOS-based MorseTestCase (unit-tests)
The main feature is to launch MOOSDB at start.
-
class
MOOSTestCase
(methodName='runTest')[source]¶
morse.testing.ros module¶
ROS-based MorseTestCase (unit-tests)
The main feature is to launch ROS core at start.
-
class
RosTestCase
(methodName='runTest')[source]¶
morse.testing.testing module¶
-
class
MorseBuilderFailureTestCase
(methodName='runTest')[source]¶ Bases:
morse.testing.testing.MorseTestCase
This subclass of MorseTestCase can be used to test MORSE handles properly ill-constructed Builder scripts.
It will fail if the Blender Game Engine get started.
-
class
MorseMoveTestCase
(methodName='runTest')[source]¶ Bases:
morse.testing.testing.MorseTestCase
This subclass of MorseTestCase can be used to check for moving actuator, basically by testing a complete pose
- This class assumes lot of stuff to work properly:
- the tested robot is called ‘robot’
- the pose sensor is called ‘robot.pose’
- if assertAlmostEqualPositionThenFix, it assumes there is a
- a ‘robot.motion’ actuator (basically what we test)
- a ‘robot.teleport’ actuator (to move to a specific situation)
-
class
MorseTestCase
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
run
(result=None)[source]¶ Overwrite unittest.TestCase::run
Detect KeyBoardInterrupt exception , due to user or a SIGINIT In particular, it can happen if we detect an exception in the Morse execution. In this case, clean up correctly the environnement.
-
setUpEnv
()[source]¶ This method must be overloaded by subclasses to define a simulation environment.
The code must follow the Builder API convention (without the import of the morsebuilder module which is automatically added).
-
setUpMw
()[source]¶ This method can be overloaded by subclasses to define environment setup, before the launching of the Morse environment pass
-
-
class
MorseTestRunner
(stream=None, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None, warnings=None, *, tb_locals=False)[source]¶ Bases:
unittest.runner.TextTestRunner
-
follow
(file)[source]¶ Really emulate tail -f
See http://stackoverflow.com/questions/1475950/tail-f-in-python-with-no-time-sleep for a detailled discussion on the subject