mirror of
https://github.com/open-webui/open-webui
synced 2025-01-19 09:16:44 +00:00
Start testing files for provider
This commit is contained in:
parent
dd16c3d5c1
commit
535e59af8d
18
backend/open_webui/test/apps/webui/storage/test_provider.py
Normal file
18
backend/open_webui/test/apps/webui/storage/test_provider.py
Normal 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")
|
Loading…
Reference in New Issue
Block a user