本文整理匯總了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())