#NEWLINE# @ mock . patch . object ( client . Client , '__init__' ) #NEWLINE# def test__build_client_with_token( self , mock_client_init ) : #NEWLINE# #INDENT# token = 'test-token-123' #NEWLINE# expected = { #NEWLINE# #INDENT# 'timeout' : 30 , #NEWLINE# 'retries' : 2 , #NEWLINE# 'insecure' : False , #NEWLINE# 'ca_cert' : 'test-file' , #NEWLINE# 'token' : token , #NEWLINE# 'endpoint_url' : 'test-url' , #NEWLINE# 'username' : 'test-admin-user' , #NEWLINE# 'tenant_name' : 'test-admin-tenant' , #NEWLINE# 'password' : 'test-admin-password' , #NEWLINE# 'auth_url' : 'test-auth-uri' , #NEWLINE# #UNINDENT# } #NEWLINE# mock_client_init . return_value = None #NEWLINE# neutron . _build_client ( token = token ) #NEWLINE# mock_client_init . assert_called_once_with ( ** expected )