Changeset View
Changeset View
Standalone View
Standalone View
swh/fuse/tests/test_mountpoint.py
# Copyright (C) 2020 The Software Heritage developers | # Copyright (C) 2020 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import os | import os | ||||
from swh.fuse.tests.data.config import ORIGIN_URL_ENCODED, REGULAR_FILE | from swh.fuse.tests.data.config import ORIGIN_URL_ENCODED, REGULAR_FILE | ||||
from swh.model.identifiers import parse_swhid | from swh.model.identifiers import parse_swhid | ||||
def test_mountpoint(fuse_mntdir): | def test_mountpoint(fuse_mntdir): | ||||
assert {"archive", "cache", "origin"} <= set(os.listdir(fuse_mntdir)) | assert {"archive", "cache", "origin", "README"} <= set(os.listdir(fuse_mntdir)) | ||||
def test_on_the_fly_mounting(fuse_mntdir): | def test_on_the_fly_mounting(fuse_mntdir): | ||||
assert os.listdir(fuse_mntdir / "archive") == [] | assert os.listdir(fuse_mntdir / "archive") == [] | ||||
assert (fuse_mntdir / "archive" / REGULAR_FILE).is_file() | assert (fuse_mntdir / "archive" / REGULAR_FILE).is_file() | ||||
assert (fuse_mntdir / "archive" / (REGULAR_FILE + ".json")).is_file() | assert (fuse_mntdir / "archive" / (REGULAR_FILE + ".json")).is_file() | ||||
assert os.listdir(fuse_mntdir / "origin") == [] | assert os.listdir(fuse_mntdir / "origin") == [] | ||||
Show All 9 Lines |