#NEWLINE# @ patch ( 'requests.sessions.Session' ) #NEWLINE# def setUp( self , session ) : #NEWLINE# #INDENT# response = { #NEWLINE# #INDENT# 'ticket' : 'ticket' , #NEWLINE# 'CSRFPreventionToken' : 'CSRFPreventionToken' , #NEWLINE# #UNINDENT# } #NEWLINE# session . request . return_value = response #NEWLINE# self . proxmox = ProxmoxAPI ( 'proxmox' , user = 'root@pam' , password = 'secret' , port = 123 , verify_ssl = False ) #NEWLINE# self . serializer = MagicMock ( ) #NEWLINE# self . session = MagicMock ( ) #NEWLINE# self . session . request . return_value . status_code = 200 #NEWLINE# self . proxmox . _store [ 'session' ] = self . session #NEWLINE# self . proxmox . _store [ 'serializer' ] = response . serializer