mirror of
https://github.com/jdejaegh/irm-kmi-api.git
synced 2025-06-27 04:05:56 +02:00
Add heat warning type
This commit is contained in:
parent
5b5c83401d
commit
5f6ff3ba30
3 changed files with 1663 additions and 0 deletions
|
@ -26,6 +26,7 @@ MAP_WARNING_ID_TO_SLUG: Final = {
|
||||||
3: 'thunder',
|
3: 'thunder',
|
||||||
7: 'fog',
|
7: 'fog',
|
||||||
9: 'cold',
|
9: 'cold',
|
||||||
|
10: 'heat',
|
||||||
12: 'thunder_wind_rain',
|
12: 'thunder_wind_rain',
|
||||||
13: 'thunderstorm_strong_gusts',
|
13: 'thunderstorm_strong_gusts',
|
||||||
14: 'thunderstorm_large_rainfall',
|
14: 'thunderstorm_large_rainfall',
|
||||||
|
|
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
|
@ -22,3 +22,18 @@ async def test_warning_data() -> None:
|
||||||
assert first.get('friendly_name') == 'Fog'
|
assert first.get('friendly_name') == 'Fog'
|
||||||
assert first.get('id') == 7
|
assert first.get('id') == 7
|
||||||
assert first.get('level') == 1
|
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') == 'heat'
|
||||||
|
assert first.get('friendly_name') == 'Heat'
|
||||||
|
assert first.get('id') == 10
|
||||||
|
assert first.get('level') == 1
|
Loading…
Add table
Reference in a new issue