Example #1
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 250000)
     cls.conn = testingtools.connect(name='TestPartsEngineMSL')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.add_engine_data(
         'LV-T30 "Reliant" Liquid Fuel Engine',
         {'max_thrust': 215000, 'isp': 300})
     cls.add_engine_data(
         'LV-T45 "Swivel" Liquid Fuel Engine',
         {'max_thrust': 200000, 'isp': 320})
     cls.add_engine_data(
         'LV-N "Nerv" Atomic Rocket Motor',
         {'max_thrust': 60000, 'isp': 800})
     cls.add_engine_data(
         'IX-6315 "Dawn" Electric Propulsion System',
         {'max_thrust': 2000, 'isp': 4200})
     cls.add_engine_data(
         'O-10 "Puff" MonoPropellant Fuel Engine',
         {'max_thrust': 20000, 'isp': 250})
     cls.add_engine_data(
         'RT-10 "Hammer" Solid Fuel Booster',
         {'max_thrust': 227000, 'isp': 195})
Example #2
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsEngine')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsSolarPanel')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsLaunchClamp')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
Example #4
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.launch_vessel_from_vab('PartsDockingPortPreAttachedTo')
        testingtools.remove_other_vessels()
        cls.conn = krpc.connect(name='TestPartsDockingPortPreAttachedTo')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.state = cls.conn.space_center.DockingPortState

        # Stack is as follows, from top to bottom:
        # parts[0] - Pod
        # parts[1] - Docking port (facing down)
        # parts[2] - Docking port (facing up)
        # parts[3] - Tank
        # parts[4] - Docking port (facing up)
        # parts[5] - Tank
        # parts[6] - Docking port (facing down)
        # parts[7] - Tank

        cls.parts = [cls.vessel.parts.root]
        cls.parts.append(filter(lambda p: p.docking_port != None, cls.parts[0].children)[0])
        part = cls.parts[-1]
        while len(part.children) == 1:
            part = part.children[0]
            cls.parts.append(part)

        cls.port1 = cls.parts[1].docking_port
        cls.port2 = cls.parts[2].docking_port
        cls.port4 = cls.parts[4].docking_port
        cls.port6 = cls.parts[6].docking_port
Example #5
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsEngine')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsEngineMSL')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.add_engine_data(
         'LV-T30 "Reliant" Liquid Fuel Engine',
         {'max_thrust': 201000, 'isp': 280.5})
     cls.add_engine_data(
         'LV-T45 "Swivel" Liquid Fuel Engine',
         {'max_thrust': 169200, 'isp': 270.7})
     cls.add_engine_data(
         'LV-N "Nerv" Atomic Rocket Motor',
         {'max_thrust': 14300, 'isp': 190.6})
     cls.add_engine_data(
         'IX-6315 "Dawn" Electric Propulsion System',
         {'max_thrust': 63, 'isp': 128.0})
     cls.add_engine_data(
         'O-10 "Puff" MonoPropellant Fuel Engine',
         {'max_thrust': 9700, 'isp': 121.2})
     cls.add_engine_data(
         'RT-10 "Hammer" Solid Fuel Booster',
         {'max_thrust': 197897, 'isp': 170.4})
     cls.add_engine_data(
         'J-33 "Wheesley" Basic Jet Engine',
         {'max_thrust': 80000, 'isp': 9600})
Example #6
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Basic')
     cls.conn = testingtools.connect(name='TestFlightAtLaunchpad')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.conn.testing_tools.remove_other_vessels()
     cls.far = cls.conn.space_center.far_available
Example #7
0
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsDockingPortInFlight')
     testingtools.set_circular_orbit('Kerbin', 100000)
     testingtools.remove_other_vessels()
     self.conn = krpc.connect(name='TestPartsDockingPortInFlight')
     self.sc = self.conn.space_center
     self.state = self.sc.DockingPortState
Example #8
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Rover')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestControlRover')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     cls.flight = cls.vessel.flight(cls.vessel.orbit.body.reference_frame)
Example #9
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsDecoupler')
     testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsDecoupler')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.SolarPanelState
 def setUpClass(cls):
     if testingtools.connect().space_center.active_vessel.name != "Parts":
         testingtools.new_save()
         testingtools.launch_vessel_from_vab("Parts")
         testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name="TestPartsReactionWheel")
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
Example #11
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsRadiator')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsRadiator')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.RadiatorState
Example #12
0
 def setUp(self):
     self.conn = krpc.connect(name='TestComms')
     if not self.conn.space_center.remote_tech_available:
         self.skipTest('RemoteTech not installed')
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Comms')
     testingtools.remove_other_vessels()
     self.vessel = self.conn.space_center.active_vessel
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsParachute')
     testingtools.remove_other_vessels()
     self.conn = krpc.connect(name='TestPartsParachute')
     self.vessel = self.conn.space_center.active_vessel
     self.parts = self.vessel.parts
     self.state = self.conn.space_center.ParachuteState
Example #14
0
 def setUpClass(cls):
     if krpc.connect().space_center.active_vessel.name != 'Parts':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('Parts')
         testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsReactionWheel')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
Example #15
0
 def setUpClass(cls):
     if krpc.connect().space_center.active_vessel.name != 'Parts':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('Parts')
         testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestParts')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.expectedAmbientTemperature = 273+20
Example #16
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestWarpOnLaunchpad')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.maximum_rails_warp_factor = 7
     cls.landed = True
Example #17
0
 def setUpClass(cls):
     if testingtools.connect().space_center.active_vessel.name != 'PartsLandingGear':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('PartsLandingGear')
         testingtools.remove_other_vessels()
     cls.conn = testingtools.connect(name='TestPartsLandingGear')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.LandingGearState
Example #18
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = krpc.connect()
     cls.control = cls.conn.space_center.active_vessel.control
     vessel = cls.conn.space_center.active_vessel
     cls.orbital_flight = vessel.flight(vessel.orbit.reference_frame)
Example #19
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Multi')
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83, 251.1)
     cls.conn = testingtools.connect(name='TestAutoPilotOtherVessel')
     next(iter(cls.conn.space_center.active_vessel.parts.docking_ports)).undock()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.other_vessel = next(iter(filter(lambda v: v != cls.vessel, cls.conn.space_center.vessels)))
Example #20
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestVessel')
     cls.vtype = cls.conn.space_center.VesselType
     cls.vsituation = cls.conn.space_center.VesselSituation
     cls.vessel = cls.conn.space_center.active_vessel
     cls.far = cls.conn.space_center.far_available
Example #21
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect(name='TestControl')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.control = cls.vessel.control
     cls.auto_pilot = cls.vessel.auto_pilot
     cls.orbital_flight = cls.vessel.flight(cls.vessel.orbital_reference_frame)
Example #22
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 700000)
     cls.conn = krpc.connect(name='TestWarpInOrbit')
     cls.sc = cls.conn.space_center
     cls.vessel = cls.sc.active_vessel
     cls.maximum_rails_warp_factor = 7
     cls.landed = False
 def setUpClass(cls):
     if krpc.connect().space_center.active_vessel.name != 'Parts':
         testingtools.new_save()
         testingtools.launch_vessel_from_vab('Parts')
         testingtools.remove_other_vessels()
     cls.conn = krpc.connect(name='TestPartsLandingLeg')
     cls.vessel = cls.conn.space_center.active_vessel
     cls.parts = cls.vessel.parts
     cls.state = cls.conn.space_center.LandingLegState
     cls.leg = cls.parts.landing_legs[0]
Example #24
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = testingtools.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.conn.testing_tools.clear_rotation()
     cls.conn.testing_tools.apply_rotation(116, (0,0,-1))
     cls.conn.testing_tools.apply_rotation(27, (-1,0,0))
     cls.conn.testing_tools.apply_rotation(40, (0,-1,0))
     cls.far = cls.conn.space_center.far_available
Example #25
0
 def test_staging(self):
     testingtools.launch_vessel_from_vab('Staging')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     self.conn = krpc.connect()
     self.control = self.conn.space_center.active_vessel.control
     for i in reversed(range(12)):
         self.assertEqual(i, self.control.current_stage)
         time.sleep(3)
         self.control.activate_next_stage()
     self.assertEqual(0, self.control.current_stage)
Example #26
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.remove_other_vessels()
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83, 251.1)
     time.sleep(5) #FIXME: remove sleep
     cls.conn = krpc.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.ap = cls.vessel.auto_pilot
     cls.sas_mode = cls.conn.space_center.SASMode
     cls.speed_mode = cls.conn.space_center.SpeedMode
Example #27
0
 def setUp(self):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('PartsDockingPortInFlight')
     testingtools.set_circular_orbit('Kerbin', 100000)
     testingtools.remove_other_vessels()
     #FIXME: sleep to prevent undocking tests from running too soon and the undocked vessel
     #       getting deleted by the previous call
     time.sleep(1)
     self.conn = krpc.connect(name='TestPartsDockingPortInFlight')
     self.sc = self.conn.space_center
     self.state = self.sc.DockingPortState
Example #28
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.launch_vessel_from_vab('Multi')
     testingtools.remove_other_vessels()
     testingtools.set_circular_orbit('Kerbin', 100000)
     cls.conn = krpc.connect(name='TestControlOtherVessel')
     next(iter(cls.conn.space_center.active_vessel.parts.docking_ports)).undock()
     cls.vessel = next(iter(filter(lambda v: v != cls.conn.space_center.active_vessel, cls.conn.space_center.vessels)))
     cls.control = cls.vessel.control
     cls.auto_pilot = cls.vessel.auto_pilot
     cls.orbital_flight = cls.vessel.flight(cls.vessel.orbital_reference_frame)
Example #29
0
 def setUpClass(cls):
     testingtools.new_save()
     testingtools.remove_other_vessels()
     testingtools.launch_vessel_from_vab('Basic')
     testingtools.set_orbit('Eve', 1070000, 0.15, 16.2, 70.5, 180.8, 1.83, 251.1)
     cls.conn = testingtools.connect()
     cls.vessel = cls.conn.space_center.active_vessel
     cls.ap = cls.vessel.auto_pilot
     cls.sas_mode = cls.conn.space_center.SASMode
     cls.speed_mode = cls.conn.space_center.SpeedMode
     cls.ap.rotation_speed_multiplier = 2
     cls.ap.roll_speed_multiplier = 2
     cls.ap.set_pid_parameters(3,0,0)
Example #30
0
    def setUpClass(cls):
        testingtools.new_save()
        testingtools.launch_vessel_from_vab('PartsDockingPort')
        testingtools.remove_other_vessels()
        cls.conn = krpc.connect(name='TestPartsDockingPort')
        cls.vessel = cls.conn.space_center.active_vessel
        cls.parts = cls.vessel.parts
        cls.state = cls.conn.space_center.DockingPortState

        # Get the three undocked ports
        ports = cls.parts.docking_ports
        cls.port1 = filter(lambda p: p.part.title == 'Clamp-O-Tron Docking Port Jr.', ports)[0]
        cls.port2 = filter(lambda p: p.part.title == 'Clamp-O-Tron Shielded Docking Port', ports)[0]
        cls.port3 = filter(lambda p: p.part.title == 'Mk2 Clamp-O-Tron', ports)[0]
        cls.port4 = filter(lambda p: p.part.title == 'Inline Clamp-O-Tron', ports)[0]