James Lu 914c5c4de3 Finish rewriting parts of the plugin
(Closes GLolol/Supybot-Weather#1)

- Removed configuration option 'disableColoredTemp' (this will likely be readded in the form of a more global, strip-all-formatting option later)
- plugin.py: copy license into file heading
- Remove unused _moonphase function
- Rewrite almanac, astronomy, and forecast (merging multiple if statements into one)
- Update tests and output formatting

Signed-off-by: James Lu <GLolol1@hotmail.com>
2015-03-13 17:18:40 -07:00

32 lines
917 B
Python

###
# Copyright (c) 2012-2014, spline
# All rights reserved.
#
#
###
from supybot.test import *
import os
class WeatherTestCase(PluginTestCase):
plugins = ('Weather',)
def setUp(self):
PluginTestCase.setUp(self)
apiKey = os.environ.get('weather_apikey')
if not apiKey:
e = """The Wunderground API key has not been set.
please set this value correctly via the environment variable
"weather_apikey"."""
raise Exception(e)
conf.supybot.plugins.Weather.apiKey.setValue(apiKey)
def testWeather(self):
self.assertNotError('reload Weather')
self.assertRegexp('wunderground 10002', 'New York, NY')
self.assertNotError('setweather 10002')
self.assertNotError('setuser metric True')
self.assertRegexp('wunderground', 'New York, NY')
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: