Merge pull request #6 from GLolol/tests-warnIfNoApiKey

test.py: Show a specific error if the apiKey is not set
This commit is contained in:
spline 2014-10-25 09:08:16 -04:00
commit b1f06c79f8

View File

@ -15,6 +15,11 @@ class WeatherTestCase(PluginTestCase):
def setUp(self):
PluginTestCase.setUp(self)
apiKey = os.environ.get('apiKey')
if not apiKey:
e = """The Wunderground API key has not been set.
please set this value correctly and try again:
'export apiKey=<key>' for bash users"""
raise Exception(e)
conf.supybot.plugins.Weather.apiKey.setValue(apiKey)
def testWeather(self):