sapling/eden/cli/filesystem.py
Chad Austin f0ace30454 fix doctor tests when host has low disk space
Summary:
The doctor tests for available disk space checked the host's actual
disk, causing them to fail when run on machines with full disks. Add a
fake and use it by default.

Reviewed By: simpkins

Differential Revision: D19145853

fbshipit-source-id: b4202a4eabffd8b7a968de9fb4370c0a0ca99d4d
2019-12-20 16:14:23 -08:00

29 lines
701 B
Python

#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import abc
import os
from . import util
class FsUtil(abc.ABC):
@abc.abstractmethod
def mkdir_p(self, path: str) -> str:
"""Performs `mkdir -p <path>` and returns the path."""
@abc.abstractmethod
def statvfs(self, path: str) -> os.statvfs_result:
"""Calls os.statvfs on the mount"""
class LinuxFsUtil(FsUtil):
def mkdir_p(self, path: str) -> str:
return util.mkdir_p(path)
def statvfs(self, path: str) -> os.statvfs_result:
return os.statvfs(path)