sapling/eden/fs/integration/health_test.py
Adam Simpkins 7846479f00 refactor the integration tests, and enable hg tests
Summary:
- Refactor the EdenClient code to better reflect how the eden currently works.
  This code was originally written when the edenfs daemon only supported
  running a single mount point.  This updates it to reflect the fact that it
  manages a single edenfs daemon, but multiple repositories can be mounted.
- Refactor the EdenTestCase now that tests generally only need a single eden
  daemon.  EdenTestCase starts the eden daemon by default.
- Add EdenHgTest and EdenGitTest classes.  These are subclasses of
  EdenTestCase, and they create and mount an hg/git repository before starting
  the test function.
- Update the tests to derive from EdenHgTest and EdenGitTest where appropriate.

Reviewed By: wez

Differential Revision: D3458842

fbshipit-source-id: 77349a60ff72a700a2c2526a27e7621b76f9eec2
2016-07-08 11:28:50 -07:00

24 lines
806 B
Python

#!/usr/bin/env python3
#
# 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.
from .lib import edenclient, testcase
class HealthTest(testcase.EdenTestCase):
def test_is_healthy(self):
self.assertTrue(self.eden.is_healthy())
self.eden.shutdown()
self.assertFalse(self.eden.is_healthy())
def test_disconnected_daemon_is_not_healthy(self):
# Create a new edenfs instance that is never started, and make sure
# it is not healthy.
with edenclient.EdenFS() as client:
self.assertFalse(client.is_healthy())