mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-02 07:34:08 +01:00
Fixed the case problem in User.list.
This commit is contained in:
parent
9788815bdd
commit
3179a8d8bc
@ -37,6 +37,7 @@ __revision__ = "$Id$"
|
||||
|
||||
import fix
|
||||
|
||||
import re
|
||||
import getopt
|
||||
import string
|
||||
import fnmatch
|
||||
@ -66,8 +67,9 @@ class User(callbacks.Privmsg):
|
||||
if glob:
|
||||
if '*' not in glob and '?' not in glob:
|
||||
glob = '*%s*' % glob
|
||||
r = re.compile(fnmatch.translate(glob), re.I)
|
||||
def p(s):
|
||||
return fnmatch.fnmatch(s, glob)
|
||||
return r.match(s) is not None
|
||||
else:
|
||||
def p(s):
|
||||
return True
|
||||
|
@ -59,6 +59,13 @@ class UserTestCase(PluginTestCase, PluginDocumentation):
|
||||
self.assertResponse('user list', 'foo')
|
||||
self.assertNotError('unregister foo bar')
|
||||
self.assertRegexp('user list', 'no registered users')
|
||||
self.assertRegexp('user list asdlfkjasldkj', 'no matching registered')
|
||||
|
||||
def testListHandlesCaps(self):
|
||||
self.prefix = self.prefix1
|
||||
self.assertNotError('register Foo bar')
|
||||
self.assertResponse('user list', 'Foo')
|
||||
self.assertResponse('user list f*', 'Foo')
|
||||
|
||||
def testChangeUsername(self):
|
||||
self.prefix = self.prefix1
|
||||
|
Loading…
Reference in New Issue
Block a user