mirror of
https://github.com/jdejaegh/irm-kmi-api.git
synced 2025-06-26 20:05:40 +02:00
Add test and fix minor issue
This commit is contained in:
parent
67f1740474
commit
dfb9ccb5ef
4 changed files with 16 additions and 4 deletions
|
@ -56,7 +56,8 @@ class RainGraph:
|
|||
self._bottom_text_y_pos: float = bottom_text_y_pos + self._background_size[1]
|
||||
self._api_client = api_client
|
||||
|
||||
self._frame_count: int = len(self._animation_data['sequence'])
|
||||
self._sequence = self._animation_data['sequence'] if self._animation_data['sequence'] is not None else []
|
||||
self._frame_count: int = max(len(self._sequence), 1)
|
||||
self._graph_width: float = self._svg_width - 2 * self._inset
|
||||
self._graph_bottom: float = self._top_text_space + self._graph_height
|
||||
self._svg_height: float = self._graph_height + self._top_text_space + self._bottom_text_space
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
"""Tests for the IRM KMI custom integration."""
|
||||
# Test suite inspired by https://github.com/home-assistant/core/tree/dev/tests/components/open_meteo
|
||||
"""Tests for the IRM KMI api package."""
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""Fixtures for the IRM KMI integration tests."""
|
||||
"""Fixtures for the IRM KMI api package."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
|
|
|
@ -335,3 +335,15 @@ async def test_download_many_clouds():
|
|||
for i in range(10):
|
||||
rain_graph._api_client.get_image.assert_any_call(f'image-url-{i}')
|
||||
|
||||
def test_can_build_rain_graph_with_empty_sequence():
|
||||
|
||||
# RainGraph(
|
||||
# RadarAnimationData(sequence=None),
|
||||
# 'en', 'style'
|
||||
# )
|
||||
|
||||
RainGraph(
|
||||
RadarAnimationData(sequence=[]),
|
||||
'en', 'style'
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue