From f9fc58c95ffe505887a7480384f4a7703b56fd18 Mon Sep 17 00:00:00 2001 From: GLolol Date: Fri, 24 Oct 2014 21:26:59 -0700 Subject: [PATCH] test.py: Show a *specific* error if the apiKey is not set, instead of causing a TypeError [ci skip] --- test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test.py b/test.py index 3ea0dee..8672766 100644 --- a/test.py +++ b/test.py @@ -14,6 +14,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=' for bash users""" + raise Exception(e) conf.supybot.plugins.Weather.apiKey.setValue(apiKey) def testWeather(self):