From fda6b572a7adb9c4bd329904523509dd00cd8e30 Mon Sep 17 00:00:00 2001 From: James Vega Date: Tue, 16 Nov 2004 00:55:00 +0000 Subject: [PATCH] Make sure we reply if all of our fallbacks fail. --- plugins/Weather.py | 2 ++ test/test_Weather.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/plugins/Weather.py b/plugins/Weather.py index d9bd416ef..b07ba535a 100644 --- a/plugins/Weather.py +++ b/plugins/Weather.py @@ -134,6 +134,8 @@ class Weather(callbacks.Privmsg): break except NoLocation: self.log.info('%s lookup failed as backup.', command) + irc.error('Could not retrieve weather for %s.' % + utils.quoted(location)) weather = wrap(weather, [additional('text')]) diff --git a/test/test_Weather.py b/test/test_Weather.py index 88637fe20..e1e050eae 100644 --- a/test/test_Weather.py +++ b/test/test_Weather.py @@ -71,6 +71,9 @@ if network: def testNoEscapingWebError(self): self.assertNotRegexp('ham "buenos aires"', 'WebError') + def testWeatherRepliesWithBogusLocation(self): + self.assertRegexp('weather some place that doesn\'t exist', r'.') + def testConvertConfig(self): try: convert = conf.supybot.plugins.Weather.convert()