#NEWLINE# def test_post( self ) : #NEWLINE# #INDENT# node = self . proxmox . nodes ( 'proxmox' ) #NEWLINE# node . openvz . create ( vmid = 800 , ostemplate = 'local:vztmpl/debian-6-turnkey-core_12.0-1_i386.tar.gz' , hostname = 'test' , storage = 'local' , memory = 512 , swap = 512 , cpus = 1 , disk = 4 , password = 'secret' , ip_address = '10.0.100.222' ) #NEWLINE# eq_ ( self . session . request . call_args [ 0 ] , ( 'POST' , 'https://proxmox:123/api2/json/nodes/proxmox/openvz' ) ) #NEWLINE# ok_ ( ( 'data' in self . session . request . call_args [ 1 ] ) ) #NEWLINE# data = self . session . request . call_args [ 1 ] [ 'data' ] #NEWLINE# eq_ ( data [ 'cpus' ] , 1 ) #NEWLINE# eq_ ( data [ 'disk' ] , 4 ) #NEWLINE# eq_ ( data [ 'hostname' ] , 'test' ) #NEWLINE# eq_ ( data [ 'ip_address' ] , '10.0.100.222' ) #NEWLINE# eq_ ( data [ 'memory' ] , 512 ) #NEWLINE# eq_ ( data [ 'ostemplate' ] , 'local:vztmpl/debian-6-turnkey-core_12.0-1_i386.tar.gz' ) #NEWLINE# eq_ ( data [ 'password' ] , 'secret' ) #NEWLINE# eq_ ( data [ 'storage' ] , 'local' ) #NEWLINE# eq_ ( data [ 'swap' ] , 512 ) #NEWLINE# eq_ ( data [ 'vmid' ] , 800 ) #NEWLINE# node = self . proxmox . nodes ( 'proxmox1' ) #NEWLINE# node . openvz . post ( vmid = 900 , ostemplate = 'local:vztmpl/debian-7-turnkey-core_12.0-1_i386.tar.gz' , hostname = 'test1' , storage = 'local1' , memory = 1024 , swap = 1024 , cpus = 2 , disk = 8 , password = 'secret1' , ip_address = '10.0.100.111' ) #NEWLINE# eq_ ( self . session . request . call_args [ 0 ] , ( 'POST' , 'https://proxmox:123/api2/json/nodes/proxmox1/openvz' ) ) #NEWLINE# ok_ ( ( 'data' in self . session . request . call_args [ 1 ] ) ) #NEWLINE# data = self . session . request . call_args [ 1 ] [ 'data' ] #NEWLINE# eq_ ( data [ 'cpus' ] , 2 ) #NEWLINE# eq_ ( data [ 'disk' ] , 8 ) #NEWLINE# eq_ ( data [ 'hostname' ] , 'test1' ) #NEWLINE# eq_ ( data [ 'ip_address' ] , '10.0.100.111' ) #NEWLINE# eq_ ( data [ 'memory' ] , 1024 ) #NEWLINE# eq_ ( data [ 'ostemplate' ] , 'local:vztmpl/debian-7-turnkey-core_12.0-1_i386.tar.gz' ) #NEWLINE# eq_ ( data [ 'password' ] , 'secret1' ) #NEWLINE# eq_ ( data [ 'storage' ] , 'local1' ) #NEWLINE# eq_ ( data [ 'swap' ] , 1024 ) #NEWLINE# eq_ ( data [ 'vmid' ] , 900 )