Website: Fix tests.
parent
09c6903d18
commit
6f963e4d42
|
@ -64,7 +64,7 @@ class WebsiteCallback(httpserver.SupyHTTPServerCallback):
|
||||||
|
|
||||||
def query(path, args={}):
|
def query(path, args={}):
|
||||||
args = dict([(x,y) for x,y in args.items() if y is not None])
|
args = dict([(x,y) for x,y in args.items() if y is not None])
|
||||||
url = 'http://supybot.fr.cr/api%s?%s' % (path, urlencode(args))
|
url = 'http://supybot.aperio.fr/api%s?%s' % (path, urlencode(args))
|
||||||
data = utils.web.getUrl(url)
|
data = utils.web.getUrl(url)
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
data = data.decode()
|
data = data.decode()
|
||||||
|
@ -113,7 +113,7 @@ class Website(callbacks.Plugin):
|
||||||
if irc.network == 'freenode':
|
if irc.network == 'freenode':
|
||||||
assert channel in irc.state.channels
|
assert channel in irc.state.channels
|
||||||
s = ('%s just pasted %s (type: %s): '
|
s = ('%s just pasted %s (type: %s): '
|
||||||
'http://supybot.fr.cr/paste/%s') % (
|
'http://supybot.aperio.fr/paste/%s') % (
|
||||||
bold(author),
|
bold(author),
|
||||||
bold(name),
|
bold(name),
|
||||||
bold(lexer),
|
bold(lexer),
|
||||||
|
@ -134,7 +134,7 @@ class Website(callbacks.Plugin):
|
||||||
return
|
return
|
||||||
irc.reply('%s %s' % (results['short_description'].replace('\r', '')
|
irc.reply('%s %s' % (results['short_description'].replace('\r', '')
|
||||||
.replace('\n', ' '),
|
.replace('\n', ' '),
|
||||||
'http://supybot.fr.cr/plugins/view/%s/' % name))
|
'http://supybot.aperio.fr/plugins/view/%s/' % name))
|
||||||
plugin = wrap(plugin, ['something'])
|
plugin = wrap(plugin, ['something'])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,12 +33,13 @@ from supybot.test import *
|
||||||
class WebsiteTestCase(PluginTestCase):
|
class WebsiteTestCase(PluginTestCase):
|
||||||
plugins = ('Website',)
|
plugins = ('Website',)
|
||||||
|
|
||||||
def testPlugin(self):
|
if network:
|
||||||
self.assertError('plugin')
|
def testPlugin(self):
|
||||||
self.assertError('plugin Eeigrg')
|
self.assertError('plugin')
|
||||||
self.assertResponse('plugin AttackProtector', 'This plugin aims to '
|
self.assertError('plugin Eeigrg')
|
||||||
'provide a highly configurable protection against flood and '
|
self.assertResponse('plugin AttackProtector', 'This plugin aims to '
|
||||||
'spam. http://supybot.fr.cr/plugins/view/AttackProtector/')
|
'provide a highly configurable protection against flood and '
|
||||||
|
'spam. http://supybot.aperio.fr/plugins/view/AttackProtector/')
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
|
Loading…
Reference in New Issue