test: Handle both directory removal and empty directory cases

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-02-09 23:29:21 +00:00
parent 08b541cc75
commit a293a37ef8

View File

@@ -78,4 +78,5 @@ def test_memory_reset_cleans_up_files(temp_db_dir):
memory.save("test memory", {"test": "metadata"})
assert any(temp_db_dir.iterdir()) # Directory should have files
memory.reset()
assert not any(temp_db_dir.iterdir()) # Directory should be empty
# After reset, directory should either not exist or be empty
assert not os.path.exists(temp_db_dir) or not any(temp_db_dir.iterdir())