def setUp(self):
#Create a mock vehicle object
vehicle = mock.create_autospec(Vehicle)
#Create a mock shotManager object
shotmgr = mock.create_autospec(ShotManager)
shotmgr.getParam.return_value = 0 # so mock doesn't do lazy binds
#Run the shot constructor
self.shot = multipoint.MultipointShot(vehicle, shotmgr)
#Mock cableController
self.shot.cable = mock.create_autospec(CableController)
self.shot.cable.currentU = 0.5 # half-way through spline
self.shot.cable.currentSeg = 0
# create two waypoints
loc = LocationGlobalRelative(37.873168,-122.302062, 0)
self.shot.waypoints.append(Waypoint(loc,-90,0))
self.shot.waypoints.append(Waypoint(loc,0,90))
self.shot.camSpline = CatmullRom([Vector2(-180, -90), Vector2(-90, 0), Vector2(0, 90), Vector2(90, 180)])
评论列表
文章目录