本文整理汇总了Python中app_dashboard_data.AppDashboardData.get_status_info方法的典型用法代码示例。如果您正苦于以下问题:Python AppDashboardData.get_status_info方法的具体用法?Python AppDashboardData.get_status_info怎么用?Python AppDashboardData.get_status_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app_dashboard_data.AppDashboardData
的用法示例。
在下文中一共展示了AppDashboardData.get_status_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_update_status_info
# 需要导入模块: from app_dashboard_data import AppDashboardData [as 别名]
# 或者: from app_dashboard_data.AppDashboardData import get_status_info [as 别名]
def test_update_status_info(self):
self.setupServerStatusMocks()
self.setupFakePutsAndDeletes()
fake_get_appcontroller_client = flexmock()
fake_get_appcontroller_client.should_receive('get_stats') \
.and_return([
{'ip' : '1.1.1.1',
'cpu' : '50',
'memory' : '50',
'disk' : '50',
'roles' : 'roles1'},
{'ip' : '2.2.2.2',
'cpu' : '50',
'memory' : '50',
'disk' : '50',
'roles' : 'roles1'}
])
flexmock(AppDashboardHelper).should_receive('get_appcontroller_client') \
.and_return(fake_get_appcontroller_client).once()
data1 = AppDashboardData()
data1.update_status_info()
output = data1.get_status_info()
self.assertEquals(len(output), 2)
self.assertEquals(output[0]['ip'], '1.1.1.1')
self.assertEquals(output[1]['ip'], '2.2.2.2')
示例2: test_get_status_info
# 需要导入模块: from app_dashboard_data import AppDashboardData [as 别名]
# 或者: from app_dashboard_data.AppDashboardData import get_status_info [as 别名]
def test_get_status_info(self):
self.setupServerStatusMocks()
data1 = AppDashboardData()
output = data1.get_status_info()
self.assertEquals(len(output), 2)
self.assertEquals(output[0]['ip'], '1.1.1.1')
self.assertEquals(output[1]['ip'], '2.2.2.2')