@@ 213-228 (lines=16) @@ | ||
210 | assert station_reading.td > 0 |
|
211 | ||
212 | ||
213 | async def test_get_monthly_station_data_with_channel(self) -> None: |
|
214 | """Test get_monthly_station_data endpoint with channel.""" |
|
215 | year = self.tz.localize(datetime.now()).strftime("%Y") |
|
216 | month = self.tz.localize(datetime.now()).strftime("%m") |
|
217 | station_data = await self.ims.get_monthly_station_data( |
|
218 | self.station_id, channel_id=self.channel_id, month=month, year=year |
|
219 | ) |
|
220 | ||
221 | assert station_data is not None |
|
222 | assert station_data.station_id == self.station_id |
|
223 | assert station_data.data is not None |
|
224 | assert len(station_data.data) > 0 |
|
225 | for station_reading in station_data.data: |
|
226 | assert station_reading.datetime.date().strftime("%m") == month |
|
227 | assert station_reading.datetime.date().strftime("%Y") == year |
|
228 | assert station_reading.td > 0 |
|
229 | ||
230 | def test_get_metrics_descriptions(self) -> None: |
|
231 | metrics = self.ims.get_metrics_descriptions() |
|
@@ 195-210 (lines=16) @@ | ||
192 | assert station_reading.td > 0 |
|
193 | ||
194 | ||
195 | async def test_get_monthly_station_data(self) -> None: |
|
196 | """Test get_monthly_station_data endpoint.""" |
|
197 | year = self.tz.localize(datetime.now()).strftime("%Y") |
|
198 | month = self.tz.localize(datetime.now()).strftime("%m") |
|
199 | station_data = await self.ims.get_monthly_station_data( |
|
200 | self.station_id, month=month, year=year |
|
201 | ) |
|
202 | ||
203 | assert station_data is not None |
|
204 | assert station_data.station_id == self.station_id |
|
205 | assert station_data.data is not None |
|
206 | assert len(station_data.data) > 0 |
|
207 | for station_reading in station_data.data: |
|
208 | assert station_reading.datetime.date().strftime("%Y") == year |
|
209 | assert station_reading.datetime.date().strftime("%m") == month |
|
210 | assert station_reading.td > 0 |
|
211 | ||
212 | ||
213 | async def test_get_monthly_station_data_with_channel(self) -> None: |