#NEWLINE# @ defer . inlineCallbacks #NEWLINE# def test_set_my_name( self ) : #NEWLINE# #INDENT# mocked_set = self . mock_handler . set_displayname #NEWLINE# mocked_set . return_value = defer . succeed ( ( ) ) #NEWLINE# ( code , response ) = ( yield self . mock_resource . trigger ( 'PUT' , ( '/profile/%s/displayname' % myid ) , '{"displayname": "Frank Jr."}' ) ) #NEWLINE# self . assertEquals ( 200 , code ) #NEWLINE# self . assertEquals ( mocked_set . call_args [ 0 ] [ 0 ] . localpart , '1234ABCD' ) #NEWLINE# self . assertEquals ( mocked_set . call_args [ 0 ] [ 1 ] . user . localpart , '1234ABCD' ) #NEWLINE# self . assertEquals ( mocked_set . call_args [ 0 ] [ 2 ] , 'Frank Jr.' )