def form_input(): airportName = request.form["airportName"] latLongArray = getAirportCoordinates(airportName) if latLongArray == "error": return render_template( "user_input.html", errorMessage="Error wrong airport name. It must be exact name!") result = weatherInformation(latLongArray[0], latLongArray[1]) print(result) weather = result['weather'][0]['main'] temp = result['main']['temp'] feels_like = result['main']['feels_like'] temp_max = result['main']['temp_max'] temp_min = result['main']['temp_min'] humidity = result['main']['humidity'] return render_template("weather_output.html", weather=weather, temp=temp, feels_like=feels_like, temp_max=temp_max, temp_min=temp_min, humidity=humidity, airportName=airportName)
def test_airportErrorCheck3(): assert getAirportCoordinates("hello") == "error"
def test_airportCheck1(): assert getAirportCoordinates("Total Rf Heliport") == [ '40.07080078', '-74.93360138' ]
def test_airportErrorCheck2(): assert getAirportCoordinates("SF") == "error"
def test_airportErrorCheck1(): assert getAirportCoordinates("Boston") == "error"
def test_airportCheck4(): assert getAirportCoordinates("Frazier Lake Airpark") == [ '36.95330048', '-121.4649963' ]
def test_airportCheck3(): assert getAirportCoordinates("Williams Ag Airport") == [ '39.427188', '-121.763427' ]
def test_airportCheck2(): assert getAirportCoordinates("Lowell Field") == [ '59.94919968', '-151.6959991' ]