Skip to content

Commit 1662817

Browse files
rhussCopilot
andauthored
Update tests/core/test_attachment_storage.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent c4e31ec commit 1662817

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/core/test_attachment_storage.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ def test_get_attachment_metadata_returns_none_for_unknown_id(self):
4545
"""Test that get_attachment_metadata returns None for unknown file_id."""
4646
from core.attachment_storage import AttachmentStorage
4747

48-
storage = AttachmentStorage()
49-
metadata = storage.get_attachment_metadata("nonexistent-uuid")
48+
with tempfile.TemporaryDirectory() as tmpdir:
49+
with patch("core.attachment_storage.STORAGE_DIR", Path(tmpdir)):
50+
storage = AttachmentStorage()
51+
metadata = storage.get_attachment_metadata("nonexistent-uuid")
5052

51-
assert metadata is None
53+
assert metadata is None
5254

5355
def test_get_attachment_path_returns_path_for_valid_id(self):
5456
"""Test that get_attachment_path returns correct path."""

0 commit comments

Comments
 (0)