def test_update_catalog_image_type(self, context): """ <b>Description:</b> Checks if value of image type can be updated. <b>Input data:</b> 1. image type: JAVA 2. image state: REQUESTED <b>Expected results:</b> Test passes when value of image type is updated. <b>Steps:</b> 1. Create catalog image with image type: JAVA, state: REQUESTED. 2. Update image type on GO. 3. Check that the image was updated """ step("Create catalog image with image type JAVA") test_image = CatalogImage.create(context, image_type=TapApplicationType.JAVA, state=TapEntityState.REQUESTED) step("Update image type on GO") test_image.update(field_name="type", value=TapApplicationType.GO) step("Check that the image was updated") image = CatalogImage.get(image_id=test_image.id) assert test_image == image
def test_update_catalog_image_state(self, context, test_sample_apps): """ <b>Description:</b> Checks if value of image state can be updated. <b>Input data:</b> 1. image type: JAVA 2. image state: REQUESTED <b>Expected results:</b> Test passes when value of image state is updated. <b>Steps:</b> 1. Create catalog image with image type: JAVA, state: REQUESTED. 2. Update image state on PENDING. 3. Check that the image was updated. """ step("Create catalog image with image state REQUESTED") test_image = CatalogImage.create(context, image_type=TapApplicationType.JAVA, state=TapEntityState.REQUESTED, blob_type="TARGZ") test_image.ensure_in_state(TapEntityState.REQUESTED) Blob.create_from_file(context, blob_id=test_image.id, file_path=test_sample_apps[ SampleAppKeys.TAPNG_NODEJS_APP].filepath) Image.create(context, image_id=test_image.id) image = CatalogImage.get(image_id=test_image.id) image.ensure_in_state(TapEntityState.REQUESTED) step("Update image state on PENDING") test_image.update(field_name="state", value=TapEntityState.PENDING) step("Check that the image state was changed to READY or BUILDING") image = CatalogImage.get(image_id=test_image.id) assert image.state == TapEntityState.BUILDING or image.state == TapEntityState.READY