mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-05-02 16:31:11 -05:00
test.py: Show a *specific* error if the apiKey is not set, instead of causing a TypeError [ci skip]
This commit is contained in:
parent
85f982b7de
commit
f9fc58c95f
5
test.py
5
test.py
@ -14,6 +14,11 @@ class WeatherTestCase(PluginTestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
PluginTestCase.setUp(self)
|
PluginTestCase.setUp(self)
|
||||||
apiKey = os.environ.get('apiKey')
|
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)
|
conf.supybot.plugins.Weather.apiKey.setValue(apiKey)
|
||||||
|
|
||||||
def testWeather(self):
|
def testWeather(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user