Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
Remove precipitation_in_hour as #12 will not be implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMitchL committed Oct 30, 2016
1 parent 6fd9cad commit f7b7ae3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
8 changes: 0 additions & 8 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,6 @@ def __str__(self):
lng=self.location.lng,
time=time)

def precipitation_in_hour(self):
"""
This will return a boolean indicating if precipitation is expected during the current hour
:return: boolean
"""
# if this is found to not be very accurate, using precipProbability would be an alternative
return True if self.__forecast.minutely().icon in ['rain', 'snow', 'sleet'] else False


class WeatherBotString:
"""
Expand Down
11 changes: 0 additions & 11 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,17 +312,6 @@ def test_alerts(self, mock_get):
self.assertEqual(wd.alerts[1].title, 'Beach Hazards Statement for Los Angeles, CA')
self.assertEqual(wd.alerts[2].title, 'Red Flag Warning for Los Angeles, CA')

@mock.patch('requests.get', side_effect=mocked_requests_get)
def test_precipitation_in_hour(self, mock_get):
"""Testing if precipitation is expected in the hour"""
location = models.WeatherLocation(34.2, -118.36, 'Los Angeles, CA')
forecast = forecastio.manual('fixtures/us_cincinnati.json')
wd = models.WeatherData(forecast, location)
self.assertTrue(wd.precipitation_in_hour())
forecast = forecastio.manual('fixtures/us.json')
wd = models.WeatherData(forecast, self.location)
self.assertFalse(wd.precipitation_in_hour())


class WeatherBotString(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit f7b7ae3

Please sign in to comment.