Changeset View
Changeset View
Standalone View
Standalone View
swh/fuse/tests/test_meta.py
- This file was added.
import json | |||||
from os import listdir | |||||
from swh.fuse.tests.common import get_data_from_archive | |||||
from swh.fuse.tests.data.config import MOUNTPOINTS | |||||
def test_list_meta_dir(fuse_mntdir): | |||||
dir_path = fuse_mntdir / "meta" | |||||
expected = map(lambda x: x + ".json", MOUNTPOINTS) | |||||
actual = listdir(dir_path) | |||||
assert set(actual) == set(expected) | |||||
def test_access_meta_file(fuse_mntdir): | |||||
for swhid in MOUNTPOINTS: | |||||
file_path = fuse_mntdir / f"meta/{swhid}.json" | |||||
expected = json.dumps(get_data_from_archive(swhid)) | |||||
assert file_path.read_text() == expected |