mirror of
https://github.com/progval/Limnoria.git
synced 2025-05-03 17:01:05 -05: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)
|
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(orig)
|
||||||
|
|
||||||
def testStatsUrlSnarfer(self):
|
def testStatsUrlSnarfer(self):
|
||||||
|
orig = conf.supybot.plugins.Gameknot.statSnarfer()
|
||||||
|
try:
|
||||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(True)
|
conf.supybot.plugins.Gameknot.statSnarfer.setValue(True)
|
||||||
self.assertNotError('http://gameknot.com/stats.pl?ironchefchess')
|
self.assertSnarfNotError(
|
||||||
self.assertRegexp('http://gameknot.com/stats.pl?ddipaolo&1',
|
'http://gameknot.com/stats.pl?ironchefchess')
|
||||||
|
self.assertSnarfRegexp(
|
||||||
|
'http://gameknot.com/stats.pl?ddipaolo&1',
|
||||||
r'^[^&]+$')
|
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):
|
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.gameSnarfer.setValue(False)
|
||||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(False)
|
conf.supybot.plugins.Gameknot.statSnarfer.setValue(False)
|
||||||
self.assertNoResponse('http://gameknot.com/stats.pl?ironchefchess')
|
self.assertSnarfNoResponse(
|
||||||
self.assertNoResponse('http://gameknot.com/chess.pl?bd=907498')
|
'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.gameSnarfer.setValue(True)
|
||||||
conf.supybot.plugins.Gameknot.statSnarfer.setValue(True)
|
conf.supybot.plugins.Gameknot.statSnarfer.setValue(True)
|
||||||
self.assertNotError('http://gameknot.com/stats.pl?ironchefchess')
|
self.assertSnarfNotError(
|
||||||
self.assertNotError('http://gameknot.com/chess.pl?bd=907498')
|
'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):
|
def testSnarfer(self):
|
||||||
@ -91,6 +110,5 @@ if network:
|
|||||||
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(orig)
|
conf.supybot.plugins.Gameknot.gameSnarfer.setValue(orig)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user