#NEWLINE# @ test . attr ( type = 'gate' ) #NEWLINE# def test_api_backups_post( self ) : #NEWLINE# #INDENT# backup_metadata = { #NEWLINE# #INDENT# 'action' : 'backup' , #NEWLINE# 'always_level' : '' , #NEWLINE# 'backup_media' : 'fs' , #NEWLINE# 'client_id' : 'freezer' , #NEWLINE# 'client_version' : '1.2.18' , #NEWLINE# 'container_segments' : '' , #NEWLINE# 'curr_backup_level' : 0 , #NEWLINE# 'dry_run' : '' , #NEWLINE# 'log_file' : '' , #NEWLINE# 'job_id' : '76cf6739ca2e4dc58b2215632c2a0b49' , #NEWLINE# 'os_auth_version' : '' , #NEWLINE# 'path_to_backup' : '/dev/null' , #NEWLINE# 'proxy' : '' , #NEWLINE# 'ssh_host' : '' , #NEWLINE# 'ssh_key' : '' , #NEWLINE# 'ssh_port' : 22 , #NEWLINE# 'ssh_username' : '' , #NEWLINE# 'storage' : 'swift' , #NEWLINE# 'container' : 'test_freezer_api_backups_container' , #NEWLINE# 'hostname' : 'localhost' , #NEWLINE# 'backup_name' : 'test_freezer_api_backups_name' , #NEWLINE# 'time_stamp' : 1459349846 , #NEWLINE# 'level' : 1 , #NEWLINE# 'max_level' : 14 , #NEWLINE# 'mode' : 'fs' , #NEWLINE# 'fs_real_path' : '/dev/null' , #NEWLINE# 'vol_snap_path' : '' , #NEWLINE# 'total_broken_links' : 1 , #NEWLINE# 'total_fs_files' : 100 , #NEWLINE# 'total_directories' : 100 , #NEWLINE# 'backup_size_uncompressed' : 10000 , #NEWLINE# 'backup_size_compressed' : 1000 , #NEWLINE# 'compression' : 'gzip' , #NEWLINE# 'encrypted' : False , #NEWLINE# 'client_os' : 'linux2' , #NEWLINE# 'broken_links' : [ ] , #NEWLINE# 'excluded_files' : [ ] , #NEWLINE# 'cli' : 'freezer' , #NEWLINE# 'version' : '1.0' , #NEWLINE# #UNINDENT# } #NEWLINE# ( resp , response_body ) = self . freezer_api_client . post_backups ( backup_metadata ) #NEWLINE# self . assertEqual ( 201 , resp . status ) #NEWLINE# self . assertIn ( 'backup_id' , response_body ) #NEWLINE# backup_id = response_body [ 'backup_id' ] #NEWLINE# ( resp , response_body ) = self . freezer_api_client . delete_backups ( backup_id ) #NEWLINE# self . assertEqual ( 204 , resp . status )