#NEWLINE# @ patch ( 'requests.sessions.Session' ) #NEWLINE# def test_https_connection( req_session ) : #NEWLINE# #INDENT# response = { #NEWLINE# #INDENT# 'ticket' : 'ticket' , #NEWLINE# 'CSRFPreventionToken' : 'CSRFPreventionToken' , #NEWLINE# #UNINDENT# } #NEWLINE# req_session . request . return_value = response #NEWLINE# ProxmoxAPI ( 'proxmox' , user = 'root@pam' , password = 'secret' , port = 123 , verify_ssl = False ) #NEWLINE# call = req_session . return_value . request . call_args [ 1 ] #NEWLINE# eq_ ( call [ 'url' ] , 'https://proxmox:123/api2/json/access/ticket' ) #NEWLINE# eq_ ( call [ 'data' ] , { #NEWLINE# #INDENT# 'username' : 'root@pam' , #NEWLINE# 'password' : 'secret' , #NEWLINE# #UNINDENT# } ) #NEWLINE# eq_ ( call [ 'method' ] , 'post' ) #NEWLINE# eq_ ( call [ 'verify' ] , False )