Start testing files for provider

This commit is contained in:
Rodrigo Agundez 2025-01-16 08:10:17 +08:00
parent dd16c3d5c1
commit 535e59af8d

View File

@ -0,0 +1,18 @@
import pytest
from open_webui.storage import provider
def test_imports():
provider.StorageProvider
provider.LocalStorageProvider
provider.S3StorageProvider
provider.Storage
def test_get_storage_provider():
Storage = provider.get_storage_provider("local")
assert isinstance(Storage, provider.LocalStorageProvider)
Storage = provider.get_storage_provider("s3")
assert isinstance(Storage, provider.S3StorageProvider)
with pytest.raises(RuntimeError):
provider.get_storage_provider("invalid")