def __init__(self): self.planes = { plane0 = Plane(id=0, size="small", speed=1, airport_dest=0, airport_src=3, dt_depart=NOW, dt_arrival=NOW + 1, currentPassengerCount=0, maxPassengerCount=500), plane1 = Plane(id=1, size="small", speed=1, airport_dest=1, airport_src=2, dt_depart=NOW, dt_arrival=NOW + 1, currentPassengerCount=0, maxPassengerCount=500), plane0 = Plane(id=0, size="small", speed=1, airport_dest=0, airport_src=1, dt_depart=NOW, dt_arrival=NOW + 1, currentPassengerCount=0, maxPassengerCount=500), plane1 = Plane(id=1, size="small", speed=1, airport_dest=2, airport_src=3, dt_depart=NOW, dt_arrival=NOW + 1, currentPassengerCount=0, maxPassengerCount=500), } self.airports = { airport00 = Airport(id=0, name="0", x=0, y=0), airport01 = Airport(id=1, name="0", x=0, y=10), airport10 = Airport(id=2, name="0", x=10, y=0), airport11 = Airport(id=3, name="1", x=10, y=10), } def getPlane(id)
def has_airport(doesHave: bool): return Airport(id=1, name="test", x=1, y=1) if doesHave else None
def test_list_airlines_Null(self, mock_airlines): airport1 = Airport(id=1, name="test", x=1, y=1) mock_airlines.getAirlines.side_effect = FakeAirlines.getAirlines( airport1.id) self.assertEqual(airport1.getAirlines(), None)
def test_list_runways(self, mock_runways): airport1 = Airport(id=1, name="test", x=1, y=1) mock_airlines.getRunways.side_effect = FakeRunways.getRunways( airport1.id) self.assertEqual(airport1.getRunways(), not None)