Esempio n. 1
0
 def test_diesel_car_number_diesel_cylinders(self):
     diesel_car = DieselCar()
     self.assertEqual(1, diesel_car.getNumberDieselCylinders())
     diesel_car.setNumberDieselCylinders(4)
     self.assertEqual(4, diesel_car.getNumberDieselCylinders())
Esempio n. 2
0
car2.setMileage(653)
car2.setNumberCylinders(4)
print 'Petrol car type: ' + car2.getMake()
print 'Model: ' + car2.getModel()
print 'Colour: ' + car2.getColour()
print 'Number of cylinders: ' + str(car2.getNumberCylinders())
print 'Mileage on the clock: ' + str(car2.getMileage())
print '------------------'

# Diesel car
car3 = DieselCar()
car3.setMake('Ford')
car3.setModel('Mondeo')
car3.setColour('Black')
car3.setMileage(2500)
car3.setNumberDieselCylinders(6)
print 'Diesel car type: ' + car3.getMake()
print 'Model: ' + car3.getModel()
print 'Colour: ' + car3.getColour()
print 'Number of cylinders: ' + str(car3.getNumberDieselCylinders())
print 'Mileage on the clock: ' + str(car3.getMileage())
print '------------------'

# Hybrid car
car4 = HybridCar()
car4.setMake('Ford')
car4.setModel('Fusion Hybrid')
car4.setColour('Blue')
car4.setMileage(600)
car4.setNumberVoltCells(28)
print 'Hybrid car type: ' + car4.getMake()