def test_1(self):
     """
     -Check if return value for runSimulation() is a float
     """
     result = ps7.runSimulation(1, 1.0, 2, 2, 0.5, 2, ps7.StandardRobot)
     test = isinstance(result, float)
     msg = "The runSimulation() function must return a float"
     self.assertTrue(test, msg)
Example #2
0
 def test_1(self):
     '''
     -Check if return value for runSimulation() is a float
     '''
     result = ps7.runSimulation(1, 1.0, 2, 2, 0.5, 2, ps7.StandardRobot)
     test = isinstance(result, float)
     msg = ('The runSimulation() function must return a float')
     self.assertTrue(test, msg)
Example #3
0
    def test_2(self):
        '''
        -Check if room is being reset after each trial
        '''
        temp_method = ps7.RectangularRoom.__init__
        self.count = 0
        def custom_method(*args):
            self.count += 1
            return temp_method(*args)
        ps7.RectangularRoom.__init__ = custom_method

        ps7.runSimulation(1, 1.0, 2, 2, 0.5, 2, ps7.StandardRobot)
        test = self.count > 1
        msg = ('The RectangularRoom object is only being created once, ' + 
               'you\'re probably not resetting the room after each trial.')
        self.assertTrue(test, msg)
        reload(ps7)
Example #4
0
import math
import random
import ps7_visualize
import pylab
from ps7_verify_movement27 import testRobotMovement
import ps7 as robot


if __name__ == "__main__":
	robot.runSimulation(1, 1.5, 4, 4, 1, 1, robot.StandardRobot)