<s> """<STR_LIT>""" <EOL> import unittest <EOL> from cafe . drivers . unittest . decorators import ( <EOL> data_driven_test , DataDrivenFixture ) <EOL> from cloudcafe . common . tools . datagen import rand_name <EOL> from cloudcafe . glance . common . constants import Messages <EOL> from cloudcafe . glance . common . types import ImageStatus <EOL> from cloudcafe . glance . composite import ImagesComposite , ImagesAuthComposite <EOL> from cloudroast . glance . fixtures import ImagesFixture <EOL> from cloudroast . glance . generators import ImagesDatasetListGenerator <EOL> user_one = ImagesAuthComposite ( ) <EOL> images = ImagesComposite ( user_one ) <EOL> @ DataDrivenFixture <EOL> @ unittest . skipUnless ( <EOL> images . config . allow_post_images , '<STR_LIT>' ) <EOL> class UpdateRegisteredImage ( ImagesFixture ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> super ( UpdateRegisteredImage , cls ) . setUpClass ( ) <EOL> cls . reg_image = cls . images . behaviors . register_new_image ( <EOL> name = rand_name ( '<STR_LIT>' ) ) <EOL> @ classmethod <EOL> def tearDownClass ( cls ) : <EOL> cls . images . behaviors . resources . release ( ) <EOL> super ( UpdateRegisteredImage , cls ) . tearDownClass ( ) <EOL> @ data_driven_test ( ImagesDatasetListGenerator . UpdateImageAllowed ( <EOL> image_status = ImageStatus . QUEUED ) ) <EOL> def ddtest_update_reg_image_replace_allowed_property ( self , prop ) : <EOL> """<STR_LIT>""" <EOL> prop_key , prop_val = prop . popitem ( ) <EOL> resp = self . images . client . update_image ( <EOL> self . reg_image . id_ , replace = { prop_key : prop_val } ) <EOL> self . assertEqual ( <EOL> resp . status_code , <NUM_LIT:200> , <EOL> Messages . STATUS_CODE_MSG . format ( <NUM_LIT:200> , resp . status_code ) ) <EOL> updated_image = resp . entity <EOL> self . assertEqual ( <EOL> getattr ( updated_image , prop_key ) , prop_val , <EOL> msg = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) . format ( prop_val , <EOL> getattr ( updated_image , prop_key ) ) ) <EOL> resp = self . images . client . get_image_details ( self . reg_image . id_ ) <EOL> self . assertTrue ( resp . ok , Messages . OK_RESP_MSG . format ( resp . status_code ) ) <EOL> get_image = resp . entity <EOL> self . assertEqual ( <EOL> getattr ( get_image , prop_key ) , prop_val , <EOL> msg = ( '<STR_LIT>' <EOL> '<STR_LIT>' ) . format ( prop_val , getattr ( get_image , <EOL> prop_key ) ) ) <EOL> self . assertGreaterEqual ( <EOL> updated_image . updated_at , self . reg_image . updated_at , <EOL> msg = ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) . format ( self . reg_image . updated_at , <EOL> updated_image . updated_at ) ) </s>
