def testFalcon9StringRepresentation(self): f9 = models.Falcon9() s = ("Falcon9 Rocket\n" "\tFirstStage: consisting of 9 Merlin engines\n" "\tInterStage: composite structure connecting stages 1 and 2\n" "\tSecondStage: consisting of 1 Merlin engine\n" "\tPayload: DragonSpacecraft") self.assertEqual(str(f9), s)
def testFalcon9DetatchFirstStage(self): f9 = models.Falcon9() self.assertIsInstance(f9.firstStage, models.FirstStage) self.assertIsInstance(f9.secondStage, models.SecondStage) self.assertIsInstance(f9.interstage, models.InterStage) self.assertIsInstance(f9.payload, models.DragonSpacecraft) f9.detatchFirstStage() self.assertIsNone(f9.firstStage) self.assertIsNone(f9.interstage)
def testFlight(self): try: f9 = models.Falcon9() flight = models.Flight(f9) flight.countDown(0) flight.launch() firstStage = flight.detatchFirstStage() flight.recoverStage(firstStage) flight.jetisonPayload() except models.CatastrophicFailure: self.fail("Flight test raised a CatastrophicFailure")
def testFalcon9Initialization(self): f9 = models.Falcon9() self.assertIsInstance(f9, models.Falcon9)
def testFlightInitialization(self): f9 = models.Falcon9() flight = models.Flight(f9) self.assertIsInstance(flight, models.Flight)