Skip to content

Commit ae26dce

Browse files
visahakclaude
andcommitted
fix(tests): align subscribe audit test with warn-and-continue behavior
subscribe.py catches audit write failures and warns instead of failing. Update the test to assert returncode 0, the warning message on stderr, and that the clone is preserved. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 259a456 commit ae26dce

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/platform_integrations/test_subscribe.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ def test_rolls_back_clone_if_config_write_fails(self, temp_project_dir, local_re
194194
assert not dest.exists(), "Clone should be rolled back when config write fails"
195195

196196
@pytest.mark.skipif(_IS_WINDOWS, reason="chmod not supported on Windows")
197-
def test_rolls_back_clone_if_audit_write_fails(self, temp_project_dir, local_repo):
198-
"""If audit_append raises after a successful clone + config write, the clone is removed."""
197+
def test_warns_when_audit_write_fails(self, temp_project_dir, local_repo):
198+
"""If audit_append raises after a successful clone, subscribe still succeeds with a warning."""
199199
evolve_dir = temp_project_dir / ".evolve"
200200
evolve_dir.mkdir(parents=True)
201201
# Pre-create a read-only audit.log so audit_append raises PermissionError
@@ -212,10 +212,10 @@ def test_rolls_back_clone_if_audit_write_fails(self, temp_project_dir, local_rep
212212
)
213213
finally:
214214
audit_log.chmod(0o644)
215-
assert result.returncode != 0
216-
assert "failed to record subscription" in result.stderr
215+
assert result.returncode == 0
216+
assert "Warning: audit log could not be updated" in result.stderr
217217
dest = evolve_dir / "entities" / "subscribed" / "alice"
218-
assert not dest.exists(), "Clone should be rolled back when audit write fails"
218+
assert dest.exists(), "Clone should be kept even when audit write fails"
219219

220220

221221
class TestUnsubscribe:

0 commit comments

Comments
 (0)