本文整理汇总了Python中application.Application.resolve_monitoring_details方法的典型用法代码示例。如果您正苦于以下问题:Python Application.resolve_monitoring_details方法的具体用法?Python Application.resolve_monitoring_details怎么用?Python Application.resolve_monitoring_details使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类application.Application
的用法示例。
在下文中一共展示了Application.resolve_monitoring_details方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_detail_url
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import resolve_monitoring_details [as 别名]
def test_detail_url(self):
self.print_header()
oracle = Application({
'host_name': 'test',
'name': 'test',
'type': 'generic',
})
url = MonitoringDetail({
'host_name': 'test',
'application_name': 'test',
'application_type': 'generic',
'monitoring_type': 'URL',
'monitoring_0': 'oracle://dbadm:[email protected]:1522/svc',
})
oracle.monitoring_details.append(url)
oracle.resolve_monitoring_details()
self.assert_(len(oracle.urls) == 1)
# consol app_db_oracle class will call wemustrepeat() to create
# a fake LOGIN-detail, so there is a oracle.username
self.assert_(oracle.urls[0].username == 'dbadm')
self.assert_(oracle.urls[0].password == 'pass')
self.assert_(oracle.urls[0].hostname == 'dbsrv')
self.assert_(oracle.urls[0].port == 1522)
# will be without the / in the consol app_db_oracle class
self.assert_(oracle.urls[0].path == '/svc')
示例2: test_detail_ram
# 需要导入模块: from application import Application [as 别名]
# 或者: from application.Application import resolve_monitoring_details [as 别名]
def test_detail_ram(self):
Application.init_classes([
os.path.join(os.path.dirname(__file__), 'recipes/test6/classes'),
os.path.join(os.path.dirname(__file__), '../recipes/default/classes')])
MonitoringDetail.init_classes([
os.path.join(os.path.dirname(__file__), 'recipes/test6/classes'),
os.path.join(os.path.dirname(__file__), '../recipes/default/classes')])
self.print_header()
opsys = Application({'name': 'os', 'type': 'red hat 6.1'})
ram = MonitoringDetail({'application_name': 'os',
'application_type': 'red hat 6.1',
'monitoring_type': 'RAM',
'monitoring_0': '80',
'monitoring_1': '90',
})
opsys.monitoring_details.append(ram)
for m in opsys.monitoring_details:
print "detail", m
opsys.resolve_monitoring_details()
self.assert_(hasattr(opsys, 'ram'))
self.assert_(opsys.ram.warning == '80')