# coding=utf-8 import pytest import elib_wx from test.utils import _TestCall, _TestValue @pytest.mark.parametrize('metar_str, expected', [ ( 'KLAW 121053Z AUTO 06006KT 10SM -RA OVC050 13/12 A3001 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 P0001 ' 'T01330122', ( _TestValue(attr_name='altimeter', expected_result=30.01, get_value=True, units='inhg'), _TestCall(attr_name='_altimeter_as_str', expected='Altimeter 762mmHg, 1016hPa, 30.01inHg.', spoken=False), _TestCall( attr_name='_altimeter_as_str', expected= 'Altimeter seven six two millimeters of mercury, one zero one six hecto Pascals, ' 'three zero point zero one inches of mercury.', spoken=True), ), ), ( 'KLAW 121053Z AUTO 06006KT 10SM -RA OVC050 13/12 Q1013 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 P0001 ' 'T01330122',
# coding=utf-8 import pytest from hypothesis import given, strategies as st import elib_wx import elib_wx.static from elib_wx import avwx from test.utils import _TestCall, _TestValue _TEST_DATA = [ ( 'KLAW 121053Z AUTO 06006KT 2SM -RA 13/12 A3001', ( _TestValue(attr_name='cloud_layers', expected_result=[]), _TestCall(attr_name='_clouds_as_str', expected='Sky clear.', spoken=False), _TestCall(attr_name='_clouds_as_str', expected='Sky clear.', spoken=True), ), ), ( 'KLAW 121053Z AUTO 06006KT 10SM -RA OVC050 13/12 A3001 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 P0001 T01330122', ( _TestValue(attr_name='cloud_layers', expected_result=[ avwx.structs.Cloud(repr='OVC050', type='OVC', altitude=50,
# coding=utf-8 import pytest import elib_wx from test.utils import _TestCall, _TestValue @pytest.mark.parametrize('metar_str, expected', [ ( 'KLAW 121053Z AUTO 06006KT 10SM -RA OVC050 13/12 A3001 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 ' 'P0001 T01330122', ( _TestValue(attr_name='temperature', expected_result=13, get_value=True, units='c'), _TestValue(attr_name='temperature', expected_result=55, get_value=True, units='f'), _TestValue(attr_name='dew_point', expected_result=12, get_value=True, units='c'), _TestValue(attr_name='dew_point', expected_result=54, get_value=True, units='f'), _TestCall(attr_name='_temperature_as_str', expected='Temperature 13°C, 55°F.',
# coding=utf-8 import typing import pytest from test.utils import _TestValue @pytest.fixture( params=[ ( # Generic test 'KLAW 121053Z AUTO 06006KT 10SM OVC050 13/12 Q1013', ( _TestValue(attr_name='altimeter', expected_result=760), _TestValue(attr_name='temperature', expected_result=13), _TestValue(attr_name='wind_ground_speed', expected_result=3), _TestValue(attr_name='wind_ground_dir', expected_result=240), _TestValue(attr_name='turbulence', expected_result=0), _TestValue(attr_name='fog_enabled', expected_result=False), _TestValue(attr_name='fog_thickness', expected_result=1000), _TestValue(attr_name='fog_visibility', expected_result=6000), _TestValue(attr_name='dust_enabled', expected_result=False), _TestValue(attr_name='dust_density', expected_result=3000), _TestValue(attr_name='precipitation_code', expected_result=0), )), ( # Reported visibility at 5000 'KLAW 121053Z AUTO 06006KT 5000 -RA OVC050 13/12 Q1013', (
# coding=utf-8 import pytest import elib_wx from test.utils import _TestCall, _TestValue @pytest.mark.parametrize('metar_str, expected', [ ( 'KLAW 121053Z AUTO 06006KT 10SM -RA OVC050 13/12 A3001 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 P0001 ' 'T01330122', ( _TestValue(attr_name='wind_speed', expected_result=6, get_value=True, units='kt'), _TestValue(attr_name='wind_direction', expected_result=60, get_value=True), _TestCall(attr_name='_wind_as_str', expected='Wind 060 6kts.', spoken=False), _TestCall(attr_name='_wind_as_str', expected='Wind zero six zero six knots.', spoken=True), ), ), ( 'KLAW 121053Z AUTO 00005MPS 10SM -RA OVC050 13/12 A3001 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 P0001 ' 'T01330122',
# coding=utf-8 import pytest import elib_wx from test.utils import _TestCall, _TestValue @pytest.mark.parametrize( 'metar_str, expected', [ ( 'KLAW 121053Z AUTO 06006KT 10SM -RA OVC040 13/12 A3001 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 P0001 ' 'T01330122', ( _TestValue(attr_name='visibility', expected_result=16100, get_value=True), _TestValue(attr_name='visibility', expected_result=10, get_value=True, units='SM'), _TestCall(attr_name='_visibility_as_str', expected='Visibility 10km or more, 10SM or more.', spoken=False), _TestCall(attr_name='_visibility_as_str', expected='Visibility ten kilometers or more, ten miles or more.', spoken=True), ), ), ( 'KLAW 121053Z AUTO 06006KT 5SM -RA OVC040 13/12 A3001 RMK AO2 LTG DSNT W RAB0957E08B45 SLP159 P0001 ' 'T01330122', ( _TestValue(attr_name='visibility', expected_result=8000, get_value=True), _TestValue(attr_name='visibility', expected_result=5, get_value=True, units='SM'),