feat: make NAS self-build deployment canonical
This commit is contained in:
+17
-1
@@ -19,4 +19,20 @@ def test_exact_dedupe_creates_hardlink(tmp_path: Path):
|
||||
actions = exact_dedupe(db, root)
|
||||
assert len(actions) == 1
|
||||
assert a.stat().st_ino == b.stat().st_ino
|
||||
assert a.read_bytes() == b.read_bytes()
|
||||
|
||||
|
||||
def test_deleting_one_hardlink_keeps_data(tmp_path: Path):
|
||||
root = tmp_path / "AllMusic"
|
||||
(root / "admin").mkdir(parents=True)
|
||||
(root / "alice").mkdir(parents=True)
|
||||
a = root / "admin" / "song.flac"
|
||||
b = root / "alice" / "song.flac"
|
||||
a.write_bytes(b"same" * 1000)
|
||||
b.write_bytes(a.read_bytes())
|
||||
db = root / ".dedupe" / "dedupe.db"
|
||||
scan(root, db)
|
||||
exact_dedupe(db, root)
|
||||
inode = a.stat().st_ino
|
||||
b.unlink()
|
||||
assert a.exists() and a.stat().st_ino == inode
|
||||
assert a.read_bytes() == b"same" * 1000
|
||||
|
||||
Reference in New Issue
Block a user