How to use delete_integration method in localstack

Best Python code snippet using localstack_python

test_ci_cd.py

Source:test_ci_cd.py Github

copy

Full Screen

...15 def teardown_class(self):16 integration_id = self.integration_tool.get_integration_id(self.integration_name)17 sonar_integration_id = self.integration_tool.get_integration_id(self.sonar_integration_name)18 # clair_integration_id = self.integration_tool.get_integration_id(self.clair_integration_name)19 self.integration_tool.delete_integration(integration_id)20 self.integration_tool.delete_integration(sonar_integration_id)21 # self.integration_tool.delete_integration(clair_integration_id)22 def test_ci_cd(self):23 # create integration instance24 create_ret = self.integration_tool.create_integration('./test_data/integration/ci_cd/create_integration.json',25 {"$INTEGRATION_NAME": self.integration_name})26 assert create_ret.status_code == 201, "创建集成中心实例失败"27 logger.info("创建集成中心实例成功")28 integration_id = create_ret.json()['id']29 # get integration instance status30 get_ret = self.integration_tool.get_integration_detail(integration_id)31 assert get_ret.status_code == 200, '获取集成中心状态失败'32 status = get_ret.json()['enabled']33 assert status, "实例不是启用状态"34 logger.info("集成实例是启用状态")35 # stop integration instance36 stop = self.integration_tool.stop_integration(integration_id,37 './test_data/integration/ci_cd/stop_integration.json',38 {"$INTEGRATION_NAME": self.integration_name})39 assert stop.status_code == 200, "停用实例操作失败"40 # get integration instance status41 get_ret = self.integration_tool.get_integration_detail(integration_id)42 assert get_ret.status_code == 200, '获取集成中心状态失败'43 status = get_ret.json()['enabled']44 assert not status, "实例停用失败"45 logger.info("实例停用成功")46 # update integration instance47 update_ret = self.integration_tool.update_integration(integration_id,48 './test_data/integration/ci_cd/update_integration.json',49 {"$INTEGRATION_NAME": self.integration_name,50 "$DESCRIPTION": self.description})51 assert update_ret.status_code == 200, "更新实例操作失败"52 # get integration instance status53 get_ret = self.integration_tool.get_integration_detail(integration_id)54 assert get_ret.status_code == 200, '获取集成中心状态失败'55 description = get_ret.json()['description']56 assert description == self.description, "更新实例失败"57 logger.info("更新实例成功")58 # delete integration instance59 delete_ret = self.integration_tool.delete_integration(integration_id)60 assert delete_ret.status_code == 204, "删除实例操作失败"61 get_ret = self.integration_tool.get_integration_detail(integration_id)62 assert get_ret.status_code == 404, "实例没有被成功删除掉"63 logger.info("删除实例成功")64 def test_sonar_integration(self):65 # create integration instance66 create_ret = self.integration_tool.create_integration(67 './test_data/integration/sonar/create_sonar_integration.json',68 {"$integration_name": self.sonar_integration_name})69 assert create_ret.status_code == 201, "创建集成中心实例失败"70 integration_id = create_ret.json()['id']71 # get integration instance status72 get_ret = self.integration_tool.get_integration_detail(integration_id)73 assert get_ret.status_code == 200, '获取集成中心状态失败'74 status = get_ret.json()['enabled']75 assert status, "实例不是启用状态"76 # stop integration instance77 stop = self.integration_tool.stop_integration(integration_id,78 './test_data/integration/sonar/stop_sonar_integration.json',79 {"$integration_name": self.sonar_integration_name})80 assert stop.status_code == 200, "停用实例操作失败"81 # get integration instance status82 get_ret = self.integration_tool.get_integration_detail(integration_id)83 assert get_ret.status_code == 200, '获取集成中心状态失败'84 status = get_ret.json()['enabled']85 assert not status, "实例停用失败"86 # update integration instance87 update_ret = self.integration_tool.update_integration(88 integration_id, './test_data/integration/sonar/update_sonar_integration.json',89 {"$integration_name": self.sonar_integration_name, "$description": self.description})90 assert update_ret.status_code == 200, "更新实例操作失败"91 # get integration instance status92 get_ret = self.integration_tool.get_integration_detail(integration_id)93 assert get_ret.status_code == 200, '获取集成中心状态失败'94 description = get_ret.json()['description']95 assert description == self.description, "更新实例失败"96 # delete integration instance97 delete_ret = self.integration_tool.delete_integration(integration_id)98 assert delete_ret.status_code == 204, "删除实例操作失败"99 get_ret = self.integration_tool.check_integration_exist(integration_id, 404)100 assert get_ret, "实例没有被成功删除掉"101 # 2.0后没有镜像扫描,所以不测clair了102 # @pytest.mark.clair_integration103 # def test_clair_integration(self):104 # # create integration instance105 # create_ret = self.integration_tool.create_integration(106 # './test_data/integration/clair/create_clair_integration.yaml',107 # {"$integration_name": self.clair_integration_name})108 #109 # assert create_ret.status_code == 201, "创建集成中心实例失败"110 #111 # integration_id = create_ret.json()['id']112 #113 # # get integration instance status114 # get_ret = self.integration_tool.get_integration_detail(integration_id)115 # assert get_ret.status_code == 200, '获取集成中心状态失败'116 #117 # status = get_ret.json()['enabled']118 #119 # assert status, "实例不是启用状态"120 #121 # # stop integration instance122 # stop = self.integration_tool.stop_integration(integration_id,123 # './test_data/integration/clair/stop_clair_integration.yaml',124 # {"$integration_id": integration_id,125 # "$integration_name": self.clair_integration_name})126 # assert stop.status_code == 200, "停用实例操作失败"127 #128 # # get integration instance status129 # get_ret = self.integration_tool.get_integration_detail(integration_id)130 # assert get_ret.status_code == 200, '获取集成中心状态失败'131 #132 # status = get_ret.json()['enabled']133 #134 # assert not status, "实例停用失败"135 #136 # # update integration instance137 # update_ret = self.integration_tool.update_integration(138 # integration_id, './test_data/integration/sonar/update_sonar_integration.yaml',139 # {"$integration_name": self.clair_integration_name, "$description": self.description})140 #141 # assert update_ret.status_code == 200, "更新实例操作失败"142 #143 # # get integration instance status144 # get_ret = self.integration_tool.get_integration_detail(integration_id)145 # assert get_ret.status_code == 200, '获取集成中心状态失败'146 #147 # description = get_ret.json()['description']148 # assert description == self.description, "更新实例失败"149 #150 # # delete integration instance151 # delete_ret = self.integration_tool.delete_integration(integration_id)152 # assert delete_ret.status_code == 204, "删除实例操作失败"153 #154 # get_ret = self.integration_tool.check_integration_exist(integration_id, 404)...

Full Screen

Full Screen

urls.py

Source:urls.py Github

copy

Full Screen

1"""2Different URL addresses required3"""4from django.conf.urls import url5#from django.urls import path6from django.urls import path7from django.contrib import admin8from .views import index, userdetails, delete_integration, view_integration9from ..yellowant_api import views10admin.autodiscover()11app_name = 'web'12urlpatterns = [13 path("user/", userdetails, name="home"),14 path("", index, name="index"),15 path("user/<int:id>", delete_integration, name="home"),16 path("accounts/<int:id>/", view_integration, name="home"),17 url(r'^(?P<path>.*)$', index, name="home"),...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful