#NEWLINE# def test_create_cluster( self ) : #NEWLINE# #INDENT# client = ambari_client . AmbariClient ( self . instance ) #NEWLINE# resp = mock . Mock ( ) #NEWLINE# resp . text = '{\n    "Requests": {\n        "id": 1,\n        "status": "InProgress"\n    }\n}' #NEWLINE# resp . status_code = 200 #NEWLINE# self . http_client . post . return_value = resp #NEWLINE# req_info = client . create_cluster ( 'cluster_name' , { #NEWLINE# #INDENT# 'some' : 'data' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( 1 , client [ 'id' ] ) #NEWLINE# self . http_client . post . assert_called_with ( 'http://1.2.3.4:8080/api/v1/clusters/cluster_name' , data = jsonutils . dumps ( { #NEWLINE# #INDENT# 'some' : 'data' , #NEWLINE# #UNINDENT# } ) , verify = False , auth = client . _auth , headers = self . headers )