2016-06-20 23:38:29 +03:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
#
|
2016-06-07 23:01:59 +03:00
|
|
|
# Copyright (c) 2016, Facebook, Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# This source code is licensed under the BSD-style license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
2016-06-20 23:38:29 +03:00
|
|
|
from .lib import edenclient, testcase
|
2016-06-07 23:01:59 +03:00
|
|
|
|
|
|
|
|
|
|
|
class HealthTest(testcase.EdenTestCase):
|
|
|
|
def test_connected_client_is_healthy(self):
|
2016-06-16 22:43:25 +03:00
|
|
|
client = edenclient.EdenClient(self)
|
2016-06-07 23:02:03 +03:00
|
|
|
client.daemon_cmd()
|
2016-06-07 23:01:59 +03:00
|
|
|
self.assertTrue(client.is_healthy())
|
2016-06-11 00:15:26 +03:00
|
|
|
client.shutdown_cmd()
|
|
|
|
self.assertFalse(client.is_healthy())
|
2016-06-07 23:01:59 +03:00
|
|
|
|
|
|
|
def test_disconnected_client_is_not_healthy(self):
|
2016-06-16 22:43:25 +03:00
|
|
|
client = edenclient.EdenClient(self)
|
2016-06-07 23:01:59 +03:00
|
|
|
self.assertFalse(client.is_healthy())
|