本文整理匯總了Python中mimic.core.MimicCore.remove_external_api方法的典型用法代碼示例。如果您正苦於以下問題:Python MimicCore.remove_external_api方法的具體用法?Python MimicCore.remove_external_api怎麽用?Python MimicCore.remove_external_api使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mimic.core.MimicCore
的用法示例。
在下文中一共展示了MimicCore.remove_external_api方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_remove_api_invalid
# 需要導入模塊: from mimic.core import MimicCore [as 別名]
# 或者: from mimic.core.MimicCore import remove_external_api [as 別名]
def test_remove_api_invalid(self):
"""
Validate API removal fails when it does not find the
api name in the listing
"""
core = MimicCore(Clock(), [])
with self.assertRaises(ServiceDoesNotExist):
core.remove_external_api(
'some-id'
)
示例2: test_remove_api_with_endpoints
# 需要導入模塊: from mimic.core import MimicCore [as 別名]
# 或者: from mimic.core.MimicCore import remove_external_api [as 別名]
def test_remove_api_with_endpoints(self):
"""
Validate an API cannot be removed if it still has
endpoints assigned to it
"""
eeapi = make_example_external_api(
self,
name=self.eeapi_name,
set_enabled=True
)
self.assertIsNotNone(eeapi)
core = MimicCore(Clock(), [eeapi])
with self.assertRaises(ServiceHasTemplates):
core.remove_external_api(
eeapi.uuid_key
)
示例3: test_remove_api
# 需要導入模塊: from mimic.core import MimicCore [as 別名]
# 或者: from mimic.core.MimicCore import remove_external_api [as 別名]
def test_remove_api(self):
"""
Removing an API.
"""
eeapi = make_example_external_api(
self,
name=self.eeapi_name,
set_enabled=True
)
self.assertIsNotNone(eeapi)
template_ids = [ept.id_key for ept in eeapi.list_templates()]
for template_id in template_ids:
eeapi.remove_template(template_id)
core = MimicCore(Clock(), [eeapi])
core.remove_external_api(
eeapi.uuid_key
)