from io import BytesIO from iti.storage import StorageManager def test_local_storage_roundtrip(tmp_path): StorageManager._instances.clear() storage = StorageManager.get_storage( "local", config={"LOCAL": {"base_path": str(tmp_path)}}, ) storage.upload(BytesIO(b"hello"), "a/b.txt", "text/plain") assert storage.exists("a/b.txt") is True assert storage.download("a/b.txt").read() == b"hello" storage.delete("a/b.txt") assert storage.exists("a/b.txt") is False