#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def test_set_other_name( self ) : #NEWLINE# #INDENT# mocked_set = self . mock_handler . set_displayname #NEWLINE# mocked_set . side_effect = SynapseError ( 400 , 'message' ) #NEWLINE# ( code , response ) = ( yield self . mock_resource . trigger ( 'PUT' , ( '/profile/%s/displayname' % '@opaque:elsewhere' ) , '{"displayname":"bob"}' ) ) #NEWLINE# self . assertTrue ( ( 400 <= code <= 499 ) , msg = ( 'code %d is in the 4xx range' % code ) )