Beispiel #1
0
def test_airport_take_off():
    airport = Airport()
    weather = Weather()
    allow(weather).weather_check.and_return('sunny')
    airport.land("plane")
    airport.take_off("plane")
    assert airport.hangar == []
Beispiel #2
0
def test_airport_capacity():
    airport = Airport()
    weather = Weather()
    allow(weather).weather_check.and_return('sunny')
    airport.land("plane")
    airport.land("plane")
    airport.land("plane")
    assert airport.land("plane") == "Hangar Capacity Reached!"
Beispiel #3
0
def test_weather_land():
    airport = Airport()
    allow(airport.weather).and_return('stormy')
    assert airport.land("plane") == "Weather Troubles! No landings permitted!"
Beispiel #4
0
def test_weather_take_off():
    airport = Airport()
    airport.land("plane")
    allow(airport).weather_check.and_return('stormy')
    assert airport.take_off(
        "plane") == "Weather Troubles! No take offs permitted!"
Beispiel #5
0
def test_set_capacity():
    airport = Airport(1)
    airport.land("plane")
    assert airport.land("plane") == "Hangar Capacity Reached!"
Beispiel #6
0
 def test_land_puts_plane_in_hanger(self):
     airport = Airport()
     plane = 'plane'
     airport.land(plane)
     assert plane in airport.hanger