Closed Dhud6 closed 5 months ago
Initial update to flight.py. I added the basic setup for the class. This will probably need to be updated in the future once the other modules are created. Still need to create the pytest for this module.
Updated flight.py. Started creating the pytest file for it.
Write the
models/flight.py
module. The module should contain aFlight
class. Unlike theRoute
class from theroute
module, which represents a generic route that can be flown, theFlight
class represents a flight that is flown by an aircraft. Check for all constraints in the constructor. If a bad type is given, raise aTypeError
; if a bad value is given (e.g. a negative flight number), raise aValueError
. All tests should test for both legal and illegal values (to verify that the class works as intended and catches errors). If you find yourself repeating code across unit tests, consider abstracting the repeated code into a pytest fixture.with the following data members:
Aircraft
from themodels.aircraft
module)Route
from themodels.route
module)Passenger
from themodels.passenger
module)you should test: