mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 08:38:30 +00:00
test: Handle both directory removal and empty directory cases
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -78,4 +78,5 @@ def test_memory_reset_cleans_up_files(temp_db_dir):
|
|||||||
memory.save("test memory", {"test": "metadata"})
|
memory.save("test memory", {"test": "metadata"})
|
||||||
assert any(temp_db_dir.iterdir()) # Directory should have files
|
assert any(temp_db_dir.iterdir()) # Directory should have files
|
||||||
memory.reset()
|
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())
|
||||||
|
|||||||
Reference in New Issue
Block a user