Source code for esrf_pathlib.tests.utils
import os
from .._schemas import constants
if constants.IS_WINDOWS:
_ROOT_SEGMENTS = ("X:\\",)
_SYMBOLIC_BASE_SEGMENTS = tuple()
_REAL_BASE_SEGMENTS = tuple()
else:
_ROOT_SEGMENTS = (os.path.sep,)
_SYMBOLIC_BASE_SEGMENTS = ("data",)
_REAL_BASE_SEGMENTS = ("mnt", "multipath-shares", "data")
[docs]
def make_path(*segments) -> str:
"""Construct a path under the symbolic data root for the current OS."""
return os.path.join(*_ROOT_SEGMENTS, *_SYMBOLIC_BASE_SEGMENTS, *segments)
[docs]
def make_realpath(*segments) -> str:
"""Construct a path under the real filesystem data root for the current OS."""
return os.path.join(*_ROOT_SEGMENTS, *_REAL_BASE_SEGMENTS, *segments)