diff --git a/setup.py b/setup.py index 3118c1b..798a902 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def read(fname): setup( name="python-pirateweather", - version="1.2.1", + version="1.3", author="cloneofghosts", description=("A thin Python Wrapper for the Pirate Weather API"), license="BSD 2-clause", diff --git a/tests/test_pirateweather.py b/tests/test_pirateweather.py index f88c157..1e47fc0 100644 --- a/tests/test_pirateweather.py +++ b/tests/test_pirateweather.py @@ -96,6 +96,21 @@ def test_extra_vars(self): assert forecast.response.status_code == 200 assert fc_cur.stationPressure + def test_day_night(self): + """Test the day_night data block.""" + + forecast = pirateweather.load_forecast( + self.api_key, self.lat, self.lng, units="auto", include="day_night_forecast" + ) + fc_dn = forecast.day_night() + + assert forecast.response.status_code == 200 + assert "include=day_night_forecast" in forecast.response.url + assert len(fc_dn.data) == 16 + assert fc_dn.data[0].humidity is not None + assert fc_dn.data[0].summary is not None + assert fc_dn.data[0].precipType is not None + def test_flags(self): """Test the data returned by the flags block.""" @@ -104,8 +119,8 @@ def test_flags(self): ) flags = forecast.flags() - assert len(flags.sources) == 3 - assert len(flags.sourceTimes) == 2 + assert len(flags.sources) == 4 + assert len(flags.sourceTimes) == 3 assert flags.nearestStation == 0 assert flags.units == "si" assert flags.sourceTimes.get("gfs")