What to build
tests/test_clean.py currently passes whether or not clean does anything, so it cannot detect a regression or a no-op. After this ticket the tests assert on what actually changed on disk, and any test that does not yet pass is marked xfail so CI stays green while the gap is recorded.
Every assertion in the file is of the form:
dploy.clean([source_a], dest)
assert not os.path.exists(dest_path)
os.path.exists() follows the symlink and reports False for a link whose target is missing — which is the definition of a dangling link. The assertion is therefore already true before clean runs, and stays true if clean does nothing at all. test_clean_after_stow_not_removing_invalid_link_from_other_source has the mirror-image problem: it asserts that nothing happened, which also passes trivially.
The honest check is os.path.islink(), which reports whether the link is still there regardless of whether its target resolves.
Verified by probe: with the assertions switched to islink(), all three tests fail — clean removes nothing. That is the subject of the follow-up ticket, not this one. This ticket only makes the failure visible.
Acceptance criteria
Blocked by
None — can start immediately.
What to build
tests/test_clean.pycurrently passes whether or notcleandoes anything, so it cannot detect a regression or a no-op. After this ticket the tests assert on what actually changed on disk, and any test that does not yet pass is markedxfailso CI stays green while the gap is recorded.Every assertion in the file is of the form:
os.path.exists()follows the symlink and reportsFalsefor a link whose target is missing — which is the definition of a dangling link. The assertion is therefore already true beforecleanruns, and stays true ifcleandoes nothing at all.test_clean_after_stow_not_removing_invalid_link_from_other_sourcehas the mirror-image problem: it asserts that nothing happened, which also passes trivially.The honest check is
os.path.islink(), which reports whether the link is still there regardless of whether its target resolves.Verified by probe: with the assertions switched to
islink(), all three tests fail —cleanremoves nothing. That is the subject of the follow-up ticket, not this one. This ticket only makes the failure visible.Acceptance criteria
os.path.islink(), notos.path.exists()xfailreferencing the follow-up ticket, and the suite is greendploy/Blocked by
None — can start immediately.