#NEWLINE# def testSetTopic( self ) : #NEWLINE# #INDENT# user = wFD ( self . _loggedInUser ( 'useruser' ) ) #NEWLINE# ( yield user ) #NEWLINE# user = user . getResult ( ) #NEWLINE# add = wFD ( self . realm . createGroup ( 'somechannel' ) ) #NEWLINE# ( yield add ) #NEWLINE# somechannel = add . getResult ( ) #NEWLINE# user . write ( 'JOIN #somechannel\r\n' ) #NEWLINE# other = wFD ( self . _loggedInUser ( 'otheruser' ) ) #NEWLINE# ( yield other ) #NEWLINE# other = other . getResult ( ) #NEWLINE# other . write ( 'JOIN #somechannel\r\n' ) #NEWLINE# user . transport . clear ( ) #NEWLINE# other . transport . clear ( ) #NEWLINE# other . write ( 'TOPIC #somechannel :This is the new topic.\r\n' ) #NEWLINE# response = self . _response ( other ) #NEWLINE# event = self . _response ( user ) #NEWLINE# self . assertEquals ( user , event ) #NEWLINE# self . assertEquals ( response [ 0 ] [ 0 ] , 'otheruser!otheruser@realmname' ) #NEWLINE# self . assertEquals ( response [ 0 ] [ 1 ] , 'TOPIC' ) #NEWLINE# self . assertEquals ( response [ 0 ] [ 2 ] , [ '#somechannel' , 'This is the new topic.' ] ) #NEWLINE# other . transport . clear ( ) #NEWLINE# somechannel . meta [ 'topic_date' ] = 12345 #NEWLINE# other . write ( 'TOPIC #somechannel\r\n' ) #NEWLINE# response = self . _response ( other ) #NEWLINE# self . assertEquals ( response [ 0 ] [ 1 ] , '332' ) #NEWLINE# self . assertEquals ( response [ 0 ] [ 2 ] , [ 'otheruser' , '#somechannel' , 'This is the new topic.' ] ) #NEWLINE# self . assertEquals ( response [ 1 ] [ 1 ] , '333' ) #NEWLINE# self . assertEquals ( response [ 1 ] [ 2 ] , [ 'otheruser' , '#somechannel' , 'otheruser' , '12345' ] ) #NEWLINE# other . transport . clear ( ) #NEWLINE# other . write ( 'TOPIC #asdlkjasd\r\n' ) #NEWLINE# response = self . _response ( other ) #NEWLINE# self . assertEquals ( response [ 0 ] [ 1 ] , '403' )