#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def test_stream_room_permissions( self ) : #NEWLINE# #INDENT# room_id = ( yield self . create_room_as ( self . other_user , tok = self . other_token ) ) #NEWLINE# ( yield self . send ( room_id , tok = self . other_token ) ) #NEWLINE# ( yield self . invite ( room_id , src = self . other_user , targ = self . user_id , tok = self . other_token ) ) #NEWLINE# ( code , response ) = ( yield self . mock_resource . trigger_get ( ( '/events?access_token=%s&timeout=0' % ( self . token , ) ) ) ) #NEWLINE# self . assertEquals ( 200 , code , msg = str ( response ) ) #NEWLINE# self . assertEquals ( 0 , len ( [ c for c in response [ 'chunk' ] if ( not ( ( c . get ( 'type' ) == 'm.presence' ) and ( c [ 'content' ] . get ( 'user_id' ) == self . user_id ) ) ) ] ) ) #NEWLINE# ( yield self . join ( room = room_id , user = self . user_id , tok = self . token ) )