<s> import json <EOL> from freezer_api . tests . freezer_api_tempest_plugin . tests . api import base <EOL> from tempest import test <EOL> class TestFreezerApiActions ( base . BaseFreezerApiTest ) : <EOL> @ classmethod <EOL> def resource_setup ( cls ) : <EOL> super ( TestFreezerApiActions , cls ) . resource_setup ( ) <EOL> @ classmethod <EOL> def resource_cleanup ( cls ) : <EOL> super ( TestFreezerApiActions , cls ) . resource_cleanup ( ) <EOL> @ test . attr ( type = "<STR_LIT>" ) <EOL> def test_api_actions ( self ) : <EOL> resp , response_body = self . freezer_api_client . get_actions ( ) <EOL> self . assertEqual ( <NUM_LIT:200> , resp . status ) <EOL> resp_body_json = json . loads ( response_body ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> actions = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( actions , [ ] ) <EOL> @ test . attr ( type = "<STR_LIT>" ) <EOL> def test_api_actions_post ( self ) : <EOL> action = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:1> , <EOL> '<STR_LIT>' : <NUM_LIT:0> , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False } <EOL> resp , response_body = self . freezer_api_client . post_actions ( action ) <EOL> self . assertEqual ( <NUM_LIT> , resp . status ) <EOL> self . assertIn ( '<STR_LIT>' , response_body ) <EOL> action_id = response_body [ '<STR_LIT>' ] <EOL> resp , response_body = self . freezer_api_client . get_actions ( action_id ) <EOL> self . assertEqual ( <NUM_LIT:200> , resp . status ) <EOL> resp_body_json = json . loads ( response_body ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> backup_name = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , backup_name ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> container = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , container ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> no_incremental = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( True , no_incremental ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> max_backup_level = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( <NUM_LIT:1> , max_backup_level ) <EOL> self . assertIn ( '<STR_LIT>' , response_body ) <EOL> hostname = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( False , hostname ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> _version = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( <NUM_LIT:1> , _version ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> actions = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , actions ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> src_file = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , src_file ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> always_backup_level = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( <NUM_LIT:0> , always_backup_level ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> mode = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , mode ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> encrypt_pass_file = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , encrypt_pass_file ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> max_cpu_priority = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( False , max_cpu_priority ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> user_id = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> log_file = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , log_file ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> action_id_in_resp_body = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( action_id , action_id_in_resp_body ) <EOL> action [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp , response_body = self . freezer_api_client . post_actions ( <EOL> action , action_id ) <EOL> self . assertEqual ( <NUM_LIT> , resp . status ) <EOL> self . assertIn ( '<STR_LIT:version>' , response_body ) <EOL> version = response_body [ '<STR_LIT:version>' ] <EOL> self . assertEqual ( <NUM_LIT:2> , version ) <EOL> self . assertIn ( '<STR_LIT>' , response_body ) <EOL> action_id_in_resp_body = response_body [ '<STR_LIT>' ] <EOL> self . assertEqual ( action_id , action_id_in_resp_body ) <EOL> resp , response_body = self . freezer_api_client . get_actions ( action_id ) <EOL> self . assertEqual ( <NUM_LIT:200> , resp . status ) <EOL> resp_body_json = json . loads ( response_body ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> backup_name = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , <EOL> backup_name ) <EOL> action [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> resp , response_body = self . freezer_api_client . patch_actions ( <EOL> action , action_id ) <EOL> self . assertEqual ( <NUM_LIT:200> , resp . status ) <EOL> self . assertIn ( '<STR_LIT:version>' , response_body ) <EOL> version = response_body [ '<STR_LIT:version>' ] <EOL> self . assertEqual ( <NUM_LIT:3> , version ) <EOL> self . assertIn ( '<STR_LIT>' , response_body ) <EOL> action_id_in_resp_body = response_body [ '<STR_LIT>' ] <EOL> self . assertEqual ( action_id , action_id_in_resp_body ) <EOL> resp , response_body = self . freezer_api_client . get_actions ( action_id ) <EOL> self . assertEqual ( <NUM_LIT:200> , resp . status ) <EOL> resp_body_json = json . loads ( response_body ) <EOL> self . assertIn ( '<STR_LIT>' , resp_body_json ) <EOL> backup_name = resp_body_json [ '<STR_LIT>' ] <EOL> self . assertEqual ( '<STR_LIT>' , <EOL> backup_name ) <EOL> resp , response_body = self . freezer_api_client . delete_actions ( <EOL> action_id ) <EOL> self . assertEqual ( <NUM_LIT> , resp . status ) </s>
