Example #1
0
 def get_engine(self):
     engineAmount = Engine.does_vehicle_have_engine(self.p)
     if engineAmount > 0:
         print("Since this is a " + self.p + ", it contains an engine")
     else:
         print("Since this is a " + self.p +
               ", it does not contain an engine")
Example #2
0
    def test_engine_start_shutdown(self):

        #create the engine
        engine1 = Engine()

        #test if the engine starts
        self.assertEquals(engine1.start_engine(), "on")

        #test if the engine raises an exception if we try to start a started engine
        self.assertRaises(EngineError, engine1.start_engine)

        #test if the engine shuts down
        self.assertEquals(engine1.shutdown_engine(), "off")

        #test if the engine raises an exception if we try to shutdown a stopped engine
        self.assertRaises(EngineError, engine1.shutdown_engine)
    def test_engine_start_shutdown(self):

        #create the engine
        engine1 = Engine()

        #test if the engine starts
        self.assertEquals(engine1.start_engine(), "on")

        #test if the engine raises an exception if we try to start a started engine
        self.assertRaises(EngineError, engine1.start_engine)

        #test if the engine shuts down
        self.assertEquals(engine1.shutdown_engine(), "off")

        #test if the engine raises an exception if we try to shutdown a stopped engine
        self.assertRaises(EngineError, engine1.shutdown_engine)
Example #4
0
 def test_start_car(self):
     car1 = car.Car("Random Car", [Wheel(16.5) for i in range(4)], Engine(),
                    Body(16.5, 12.6))
     self.assertTrue(car1.start_car())
Example #5
0
 def test_does_vehicle_have_engine(self):
     print("have_engine test. ")
     test = Engine()
     car = "car"
     if self.assertEqual(test.does_vehicle_have_engine(car), 1):
         return
Example #6
0
 def get_engine(self):
     return Engine()
Example #7
0
 def getEngine(self):
     engine = Engine()
     engine.horsepower = 4000
     return engine