本文整理汇总了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
)