Exemplo n.º 1
0
def test_fog(setup, fog_visibility):
    _, mission, time, icao = setup
    mission.weather.fog_visibility = fog_visibility
    mission.weather.fog_enabled = True
    metar = get_metar_from_mission('test', time=time, icao=icao)
    if fog_visibility < 5000:
        assert metar == f'{icao} {time} 00000MPS {fog_visibility:04d}M 10/10 Q1008 NOSIG'
    else:
        assert metar == f'{icao} {time} 00000MPS {fog_visibility:04d}M 10/10 Q1008 NOSIG'
Exemplo n.º 2
0
def test_no_time(setup):
    _, _, _, icao = setup
    now = datetime.utcnow()
    day = now.day
    hour = now.hour
    minute = now.minute
    time = f'{day:02}{hour:02}{minute:02}Z'
    metar = get_metar_from_mission('test', icao=icao)
    assert metar == f'{icao} {time} 00000MPS CAVOK 10/10 Q1008 NOSIG'
Exemplo n.º 3
0
def test_cloud_density(setup, density):
    _, mission, time, icao = setup
    mission.weather.cloud_density = density
    metar = get_metar_from_mission('test', time=time, icao=icao)
    if density == 0:
        assert metar == f'{icao} {time} 00000MPS CAVOK 10/10 Q1008 NOSIG'
    elif density < 4:
        assert metar == f'{icao} {time} 00000MPS CAVOK FEW262 10/10 Q1008 NOSIG'
    elif density < 7:
        assert metar == f'{icao} {time} 00000MPS CAVOK SCT262 10/10 Q1008 NOSIG'
    elif density < 9:
        assert metar == f'{icao} {time} 00000MPS CAVOK BKN262 10/10 Q1008 NOSIG'
    else:
        assert metar == f'{icao} {time} 00000MPS CAVOK OVC262 10/10 Q1008 NOSIG'
Exemplo n.º 4
0
def test_cavok(setup):
    _, mission, time, icao = setup
    mission.weather.visibility = 9998
    metar = get_metar_from_mission('test', time=time, icao=icao)
    assert 'CAVOK' not in metar
Exemplo n.º 5
0
def test_basic_metar(setup):
    _, _, time, icao = setup
    metar = get_metar_from_mission('test', time=time, icao=icao)
    assert metar == f'{icao} {time} 00000MPS CAVOK 10/10 Q1008 NOSIG'