def test_get_london_weather(self): weather = get_weather("London") self.assertEqual(weather['body']['name'], 'London') self.assertEqual(weather['body']['main']['temp'], 284.69) self.assertEqual(weather['body']['main']['temp_max'], 286.48) self.assertEqual(weather['body']['main']['temp_min'], 283.15)
def open(self): print('websocket opened!') # send them weather weather = get_weather() self.write_message({ 'command': 'load-weather', 'data': weather, }) # send them events (js_events, js_datetime_retrieved) = db.get_js_events() self.write_message({ 'command': 'load-events', 'events': js_events, 'updated': js_datetime_retrieved, })
def test_get_weather(self): weather = main.get_weather() self.assertEqual(len(weather), 1)
def test_get_weather(): assert (isinstance(get_weather(), dict) == True)
def test_get_weather(): assert get_weather()==[{"title": "Weather in Exeter", "content": "Temperature: 5.5\u00b0C, Condition: Clouds, Pressure: 981, Humidity: 87"}]