weather bot: Fix for integer division in python2 and adjust test.

Fixes #31.
This commit is contained in:
neiljp (Neil Pilgrim) 2017-07-27 08:57:47 -07:00 committed by Tim Abbott
parent 05c527a10f
commit 0a85962097
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ class TestWeatherBot(BotTestCase):
) )
# Only country query: returns the weather of the capital city # Only country query: returns the weather of the capital city
bot_response = "Weather in London, GB:\n58.33 F / 14.85 C\nShower Rain" bot_response = "Weather in London, GB:\n58.73 F / 14.85 C\nShower Rain"
with self.mock_config_info({'key': '123456'}), \ with self.mock_config_info({'key': '123456'}), \
self.mock_http_conversation('test_only_country'): self.mock_http_conversation('test_only_country'):
self.initialize_bot() self.initialize_bot()

View file

@ -53,6 +53,6 @@ def to_celsius(temp_kelvin):
def to_fahrenheit(temp_kelvin): def to_fahrenheit(temp_kelvin):
return int(temp_kelvin) * 9 / 5 - 459.67 return int(temp_kelvin) * (9. / 5.) - 459.67
handler_class = WeatherHandler handler_class = WeatherHandler