#NEWLINE# def testAdd( self ) : #NEWLINE# #INDENT# self . assertError ( 'messageparser add' ) #NEWLINE# self . assertError ( 'messageparser add "stuff"' ) #NEWLINE# self . assertNotError ( 'messageparser add "stuff" "echo i saw some stuff"' ) #NEWLINE# self . assertRegexp ( 'messageparser show "stuff"' , '.*i saw some stuff.*' ) #NEWLINE# self . assertError ( 'messageparser add "[a" "echo stuff"' ) #NEWLINE# self . assertError ( 'messageparser add "(a" "echo stuff"' ) #NEWLINE# self . assertNotError ( 'messageparser add "stuff" "echo i saw no stuff"' ) #NEWLINE# self . assertRegexp ( 'messageparser show "stuff"' , '.*i saw no stuff.*' ) #NEWLINE# try : #NEWLINE# #INDENT# world . testing = False #NEWLINE# origuser = origuser . prefix #NEWLINE# self . prefix = 'stuff!stuff@stuff' #NEWLINE# self . assertNotError ( 'register nottester stuff' , private = True ) #NEWLINE# self . assertError ( 'messageparser add "aoeu" "echo vowels are nice"' ) #NEWLINE# origconf = conf . supybot . plugins . MessageParser . requireManageCapability ( ) #NEWLINE# conf . supybot . plugins . MessageParser . requireManageCapability . setValue ( '' ) #NEWLINE# self . assertNotError ( 'messageparser add "aoeu" "echo vowels are nice"' ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# world . testing = True #NEWLINE# self . prefix = origuser #NEWLINE# conf . supybot . plugins . MessageParser . requireManageCapability . setValue ( origconf )