本文整理汇总了Python中djblets.integrations.manager.IntegrationManager.get_integration方法的典型用法代码示例。如果您正苦于以下问题:Python IntegrationManager.get_integration方法的具体用法?Python IntegrationManager.get_integration怎么用?Python IntegrationManager.get_integration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类djblets.integrations.manager.IntegrationManager
的用法示例。
在下文中一共展示了IntegrationManager.get_integration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_get_integration
# 需要导入模块: from djblets.integrations.manager import IntegrationManager [as 别名]
# 或者: from djblets.integrations.manager.IntegrationManager import get_integration [as 别名]
def test_get_integration(self):
"""Testing IntegrationManager.get_integration"""
manager = IntegrationManager(IntegrationConfig)
manager.register_integration_class(DummyIntegration1)
manager.register_integration_class(DummyIntegration2)
integration = manager.get_integration(DummyIntegration1.integration_id)
self.assertEqual(integration.__class__, DummyIntegration1)
integration = manager.get_integration(DummyIntegration2.integration_id)
self.assertEqual(integration.__class__, DummyIntegration2)
示例2: test_get_integration_with_invalid_id
# 需要导入模块: from djblets.integrations.manager import IntegrationManager [as 别名]
# 或者: from djblets.integrations.manager.IntegrationManager import get_integration [as 别名]
def test_get_integration_with_invalid_id(self):
"""Testing IntegrationManager.get_integration with invalid ID"""
manager = IntegrationManager(IntegrationConfig)
with self.assertRaises(IntegrationNotRegisteredError):
manager.get_integration("foobar")