Best Python code snippet using tempest_python
deploy.py
Source:deploy.py  
...222			and release_status.get("reason") == "Not Found"223			and job_status.get("error")224			and job_status.get("reason") == "Not Found"225		):226			delete_image_tag("erpnext-worker", improvement.name)227			delete_image_tag("erpnext-nginx", improvement.name)228			improvement.deployment_status = None229			improvement.save()230			frappe.db.commit()231	except frappe.DoesNotExistError:232		print("No Improvement is 'Release Deleted' state")233def create_build_job(improvement):234	image_tag = improvement.target_branch235	if "-hotfix" in improvement.target_branch:236		image_tag = improvement.target_branch.rstrip("-hotfix")237	res = create_build_image_job(238		improvement=improvement,239		image_tag=image_tag,240		git_repo=improvement.fork_url,241		git_branch=improvement.source_branch,...test_images_rbac.py
Source:test_images_rbac.py  
...124                data_utils.rand_name(self.__class__.__name__ + '-tag'))125    @decorators.idempotent_id('c4a0bf9c-b78b-48c6-a31f-72c95f943c6e')126    @rbac_rule_validation.action(service="glance",127                                 rules=["modify_image"])128    def test_delete_image_tag(self):129        """Delete image tag130        RBAC test for the glance delete_image_tag endpoint131        """132        image = self._create_image()133        tag_name = data_utils.rand_name(self.__class__.__name__ + '-tag')134        self.image_client.add_image_tag(image['id'], tag_name)135        with self.override_role():136            self.image_client.delete_image_tag(image['id'], tag_name)137    @rbac_rule_validation.action(service="glance",138                                 rules=["publicize_image"])139    @decorators.idempotent_id('0ea4809c-6461-11e6-ac4f-080027d0d606')140    def test_publicize_image(self):141        """Publicize Image Test142        RBAC test for the glance publicize_image endpoint143        """144        with self.override_role():145            self._create_image(visibility='public')146    @decorators.idempotent_id('0f2d8427-134a-4d3c-a102-5fcdf5443d09')147    @rbac_rule_validation.action(service="glance",148                                 rules=["communitize_image"])149    def test_communitize_image(self):150        """Communitize Image Test...container_registry.py
Source:container_registry.py  
...25		config.get("auths", {})26		.get(get_container_registry(), {})27		.get("auth", "YWRtaW46cGFzc3dvcmQ=")28	)29def delete_image_tag(image_name, tag_name):30	try:31		dxf_client = get_registry_client(image_name)32		res = dxf_client.del_alias(tag_name)33		return res34	except Exception as e:35		out = {36			"error": e,37			"params": {"image_name": image_name, "tag_name": tag_name},38		}39		frappe.log_error(out, "delete_image_tag")...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
