Esempio n. 1
0
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)
Esempio n. 2
0
def test_airportErrorCheck3():
    assert getAirportCoordinates("hello") == "error"
Esempio n. 3
0
def test_airportCheck1():
    assert getAirportCoordinates("Total Rf Heliport") == [
        '40.07080078', '-74.93360138'
    ]
Esempio n. 4
0
def test_airportErrorCheck2():
    assert getAirportCoordinates("SF") == "error"
Esempio n. 5
0
def test_airportErrorCheck1():
    assert getAirportCoordinates("Boston") == "error"
Esempio n. 6
0
def test_airportCheck4():
    assert getAirportCoordinates("Frazier Lake Airpark") == [
        '36.95330048', '-121.4649963'
    ]
Esempio n. 7
0
def test_airportCheck3():
    assert getAirportCoordinates("Williams Ag Airport") == [
        '39.427188', '-121.763427'
    ]
Esempio n. 8
0
def test_airportCheck2():
    assert getAirportCoordinates("Lowell Field") == [
        '59.94919968', '-151.6959991'
    ]