本文整理汇总了Python中nuclide_server.NuclideServer.is_healthy方法的典型用法代码示例。如果您正苦于以下问题:Python NuclideServer.is_healthy方法的具体用法?Python NuclideServer.is_healthy怎么用?Python NuclideServer.is_healthy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nuclide_server.NuclideServer
的用法示例。
在下文中一共展示了NuclideServer.is_healthy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multiple_servers
# 需要导入模块: from nuclide_server import NuclideServer [as 别名]
# 或者: from nuclide_server.NuclideServer import is_healthy [as 别名]
def test_multiple_servers(self):
server_9090 = NuclideServer(9090)
self.assertEquals(server_9090.start(timeout=TIMEOUT), 0)
self.assertTrue(server_9090.is_healthy())
server_9091 = NuclideServer(9091)
self.assertEquals(server_9091.start(timeout=TIMEOUT), 0)
self.assertTrue(server_9091.is_healthy())
# No server on port 9092
server_9092 = NuclideServer(9092)
self.assertFalse(server_9092.is_healthy())
self.assertEquals(server_9090.stop(), 0)
self.assertFalse(server_9090.is_healthy())
self.assertTrue(server_9091.is_healthy())
# Create new server objects to rebind and check states again.
server_9090 = NuclideServer(9090)
server_9091 = NuclideServer(9091)
self.assertFalse(server_9090.is_healthy())
self.assertTrue(server_9091.is_healthy())