mirror of
https://github.com/jdejaegh/irm-kmi-api.git
synced 2025-06-26 20:05:40 +02:00
Compare commits
3 commits
bd3b4e0a84
...
b59ca80de7
Author | SHA1 | Date | |
---|---|---|---|
b59ca80de7 | |||
3c28d2dfaf | |||
c6c4d9b585 |
6 changed files with 1667 additions and 3 deletions
|
@ -42,4 +42,4 @@ __all__ = [
|
|||
"RainGraph",
|
||||
]
|
||||
|
||||
__version__ = '1.0.3'
|
||||
__version__ = '1.1.0'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|||
|
||||
[project]
|
||||
name = "irm-kmi-api"
|
||||
version = "1.0.3"
|
||||
version = "1.1.0"
|
||||
description = "Retrieve data from the Belgian IRM KMI in Python"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "Jules Dejaeghere", email = "curable.grass491@mailer.me" }]
|
||||
|
@ -28,7 +28,7 @@ Homepage = "https://github.com/jdejaegh/irm-kmi-api"
|
|||
packages = ["irm_kmi_api", "irm_kmi_api.resources"]
|
||||
|
||||
[tool.bumpver]
|
||||
current_version = "1.0.3"
|
||||
current_version = "1.1.0"
|
||||
version_pattern = "MAJOR.MINOR.PATCH"
|
||||
commit_message = "bump version {old_version} -> {new_version}"
|
||||
tag_message = "{new_version}"
|
||||
|
|
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