-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
130 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
parsed_data = {'10724': {'city': 'Weinbiet', 'forecast': {'dayafter_to': 1, 'tomorrow': 0, 'today': 1}, 'lat': 49.383, 'lon': 8.117}, 'P0489': {'city': 'Hamburg', 'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'lat': 53.55, 'lon': 9.983}, '10261': {'forecast': {'tomorrow': 0, 'dayafter_to': 0, 'today': 0}, 'city': 'Seehausen', 'lat': 52.883, 'lon': 11.733}, '10317': {'city': 'Osnabrück', 'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'lat': 52.25, 'lon': 8.05}, '10471': {'city': 'Leipzig', 'forecast': {'tomorrow': 0, 'dayafter_to': 0, 'today': 0}, 'lat': 51.317, 'lon': 12.417}, '10739': {'city': 'Stuttgart', 'forecast': {'dayafter_to': 1, 'tomorrow': 0, 'today': 1}, 'lat': 48.833, 'lon': 9.2}, '10637': {'forecast': {'dayafter_to': 2, 'tomorrow': 1, 'today': 0}, 'city': 'Frankfurt/Main', 'lat': 50.05, 'lon': 8.6}, '10113': {'city': 'Norderney', 'forecast': {'today': 0, 'tomorrow': 0, 'dayafter_to': 0}, 'lat': 53.717, 'lon': 7.15}, '10389': {'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'city': 'Berlin', 'lat': 52.517, 'lon': 13.417}, '10791': {'forecast': {'tomorrow': 0, 'dayafter_to': 1, 'today': 1}, 'city': 'Großer Arber', 'lat': 49.117, 'lon': 13.133}, '10555': {'city': 'Weimar', 'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'lat': 50.983, 'lon': 11.317}, 'P0150': {'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'city': 'Sankt Peter-Ording', 'lat': 54.317, 'lon': 8.683}, '10929': {'city': 'Konstanz', 'forecast': {'today': 1, 'dayafter_to': 1, 'tomorrow': 0}, 'lat': 47.683, 'lon': 9.183}, '10400': {'city': 'Düsseldorf', 'forecast': {'today': 0, 'dayafter_to': 0, 'tomorrow': 0}, 'lat': 51.3, 'lon': 6.767}, '10803': {'city': 'Freiburg', 'forecast': {'dayafter_to': 1, 'tomorrow': 0, 'today': 1}, 'lat': 48.017, 'lon': 7.833}, '10361': {'forecast': {'today': 0, 'tomorrow': 0, 'dayafter_to': 0}, 'city': 'Magdeburg', 'lat': 52.117, 'lon': 11.583}, '10454': {'city': 'Wernigerode', 'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'lat': 51.85, 'lon': 10.767}, '10280': {'city': 'Neubrandenburg', 'forecast': {'today': 0, 'dayafter_to': 0, 'tomorrow': 0}, 'lat': 53.55, 'lon': 13.2}, '10519': {'forecast': {'tomorrow': 0, 'dayafter_to': 0, 'today': 1}, 'city': 'Bonn', 'lat': 50.733, 'lon': 7.183}, 'P0332': {'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'city': 'Marienleuchte', 'lat': 54.467, 'lon': 11.167}, '10496': {'city': 'Cottbus', 'forecast': {'dayafter_to': 1, 'tomorrow': 0, 'today': 0}, 'lat': 51.783, 'lon': 14.317}, '10046': {'forecast': {'today': 0, 'dayafter_to': 0, 'tomorrow': 0}, 'city': 'Kiel', 'lat': 54.383, 'lon': 10.15}, '10020': {'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'city': 'List auf Sylt', 'lat': 55.017, 'lon': 8.417}, '10091': {'city': 'Arkona', 'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'lat': 54.683, 'lon': 13.433}, '10338': {'forecast': {'today': 0, 'tomorrow': 0, 'dayafter_to': 0}, 'city': 'Hannover', 'lat': 52.467, 'lon': 9.683}, '10865': {'city': 'München', 'forecast': {'dayafter_to': 1, 'tomorrow': 0, 'today': 1}, 'lat': 48.167, 'lon': 11.533}, '10268': {'city': 'Waren', 'forecast': {'today': 0, 'dayafter_to': 0, 'tomorrow': 0}, 'lat': 53.517, 'lon': 12.667}, '10427': {'forecast': {'dayafter_to': 0, 'tomorrow': 0, 'today': 0}, 'city': 'Kahler Asten', 'lat': 51.183, 'lon': 8.483}, '10616': {'forecast': {'today': 0, 'tomorrow': 0, 'dayafter_to': 0}, 'city': 'Hahn', 'lat': 49.95, 'lon': 7.267}, '10224': {'city': 'Bremen', 'forecast': {'today': 0, 'tomorrow': 0, 'dayafter_to': 0}, 'lat': 53.05, 'lon': 8.8}, '10655': {'city': 'Würzburg', 'forecast': {'dayafter_to': 1, 'tomorrow': 0, 'today': 1}, 'lat': 49.767, 'lon': 9.967}, 'P0175': {'city': 'Rostock', 'forecast': {'today': 0, 'tomorrow': 0, 'dayafter_to': 0}, 'lat': 54.083, 'lon': 12.133}, '10838': {'forecast': {'today': 1, 'dayafter_to': 1, 'tomorrow': 0}, 'city': 'Ulm', 'lat': 48.383, 'lon': 9.95}, '10776': {'forecast': {'today': 1, 'tomorrow': 0, 'dayafter_to': 1}, 'city': 'Regensburg', 'lat': 49.033, 'lon': 12.1}, '10438': {'city': 'Kassel', 'forecast': {'tomorrow': 0, 'dayafter_to': 0, 'today': 0}, 'lat': 51.3, 'lon': 9.45}, '10487': {'forecast': {'tomorrow': 0, 'dayafter_to': 1, 'today': 1}, 'city': 'Dresden', 'lat': 51.05, 'lon': 13.733}, '10961': {'city': 'Zugspitze', 'forecast': {'tomorrow': 1, 'dayafter_to': 1, 'today': 1}, 'lat': 47.417, 'lon': 10.983}, '10763': {'forecast': {'dayafter_to': 1, 'tomorrow': 0, 'today': 0}, 'city': 'Nürnberg', 'lat': 49.5, 'lon': 11.05}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import unittest | ||
from simple_dwd_weatherforecast import dwdforecast | ||
from dummy_uv import parsed_data | ||
|
||
|
||
class UvIndexTestCase(unittest.TestCase): | ||
def setUp(self): | ||
self.dwd_weather = dwdforecast.Weather("L821") | ||
self.dwd_weather.uv_reports = parsed_data | ||
|
||
def test_uv_today(self): | ||
self.assertEqual(self.dwd_weather.get_uv_index(0), 0) | ||
|
||
def test_uv_tomorrow(self): | ||
self.assertEqual(self.dwd_weather.get_uv_index(1), 1) | ||
|
||
def test_uv_dayafter_tomorrow(self): | ||
self.assertEqual(self.dwd_weather.get_uv_index(2), 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters