weather bot: Fix for integer division in python2 and adjust test.
Fixes #31.
This commit is contained in:
parent
05c527a10f
commit
0a85962097
|
@ -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()
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue