mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +01:00
Fix a bug where we weren't catching the end of the URL appropriately
This commit is contained in:
parent
ab0eff4eea
commit
fd6f4e7e24
@ -61,20 +61,39 @@ if network:
|
||||
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(orig)
|
||||
|
||||
def testStatsUrlSnarfer(self):
|
||||
orig = conf.supybot.plugins.Gameknot.statSnarfer()
|
||||
try:
|
||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(True)
|
||||
self.assertNotError('http://gameknot.com/stats.pl?ironchefchess')
|
||||
self.assertRegexp('http://gameknot.com/stats.pl?ddipaolo&1',
|
||||
self.assertSnarfNotError(
|
||||
'http://gameknot.com/stats.pl?ironchefchess')
|
||||
self.assertSnarfRegexp(
|
||||
'http://gameknot.com/stats.pl?ddipaolo&1',
|
||||
r'^[^&]+$')
|
||||
self.assertSnarfRegexp(
|
||||
'http://gameknot.com/stats.pl?ddipaolo and some extra',
|
||||
r'^ddipaolo is rated')
|
||||
finally:
|
||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(orig)
|
||||
|
||||
def testConfig(self):
|
||||
game = conf.supybot.plugins.Gameknot.gameSnarfer()
|
||||
stat = conf.supybot.plugins.Gameknot.statSnarfer()
|
||||
try:
|
||||
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(False)
|
||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(False)
|
||||
self.assertNoResponse('http://gameknot.com/stats.pl?ironchefchess')
|
||||
self.assertNoResponse('http://gameknot.com/chess.pl?bd=907498')
|
||||
self.assertSnarfNoResponse(
|
||||
'http://gameknot.com/stats.pl?ironchefchess')
|
||||
self.assertSnarfNoResponse(
|
||||
'http://gameknot.com/chess.pl?bd=907498')
|
||||
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(True)
|
||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(True)
|
||||
self.assertNotError('http://gameknot.com/stats.pl?ironchefchess')
|
||||
self.assertNotError('http://gameknot.com/chess.pl?bd=907498')
|
||||
self.assertSnarfNotError(
|
||||
'http://gameknot.com/stats.pl?ironchefchess', timeout=20)
|
||||
self.assertSnarfNotError(
|
||||
'http://gameknot.com/chess.pl?bd=907498')
|
||||
finally:
|
||||
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(game)
|
||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(stat)
|
||||
|
||||
|
||||
def testSnarfer(self):
|
||||
@ -91,6 +110,5 @@ if network:
|
||||
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(orig)
|
||||
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user