mirror of
https://github.com/jdejaegh/irm-kmi-api.git
synced 2025-06-26 20:05:40 +02:00
commit
3c28d2dfaf
4 changed files with 1664 additions and 0 deletions
|
@ -27,6 +27,7 @@ MAP_WARNING_ID_TO_SLUG: Final = {
|
|||
3: WarningType.THUNDER,
|
||||
7: WarningType.FOG,
|
||||
9: WarningType.COLD,
|
||||
10: WarningType.HEAT,
|
||||
12: WarningType.THUNDER_WIND_RAIN,
|
||||
13: WarningType.THUNDERSTORM_STRONG_GUSTS,
|
||||
14: WarningType.THUNDERSTORM_LARGE_RAINFALL,
|
||||
|
|
|
@ -80,6 +80,7 @@ class WarningType(StrEnum):
|
|||
COLD = 'cold'
|
||||
COLDSPELL = 'coldspell'
|
||||
FOG = 'fog'
|
||||
HEAT = 'heat'
|
||||
ICE_OR_SNOW = 'ice_or_snow'
|
||||
RAIN = 'rain'
|
||||
STORM_SURGE = 'storm_surge'
|
||||
|
|
1647
tests/fixtures/antwerp_with_heat_warning.json
vendored
Normal file
1647
tests/fixtures/antwerp_with_heat_warning.json
vendored
Normal file
File diff suppressed because it is too large
Load diff
|
@ -24,6 +24,21 @@ async def test_warning_data() -> None:
|
|||
assert first.get('id') == 7
|
||||
assert first.get('level') == 1
|
||||
|
||||
async def test_warning_heat() -> None:
|
||||
api = get_api_with_data("antwerp_with_heat_warning.json")
|
||||
|
||||
result = api.get_warnings(lang='en')
|
||||
|
||||
assert isinstance(result, list)
|
||||
assert len(result) == 1
|
||||
|
||||
first = result[0]
|
||||
|
||||
assert first.get('slug') == WarningType.HEAT
|
||||
assert first.get('friendly_name') == 'Heat'
|
||||
assert first.get('id') == 10
|
||||
assert first.get('level') == 1
|
||||
|
||||
|
||||
async def test_warning_data_is_serializable() -> None:
|
||||
api = get_api_with_data("be_forecast_warning.json")
|
||||
|
|
Loading…
Add table
Reference in a new issue