From 535e59af8df5d2a3116876d21acbc306226c087d Mon Sep 17 00:00:00 2001 From: Rodrigo Agundez Date: Thu, 16 Jan 2025 08:10:17 +0800 Subject: [PATCH] Start testing files for provider --- .../test/apps/webui/storage/test_provider.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 backend/open_webui/test/apps/webui/storage/test_provider.py diff --git a/backend/open_webui/test/apps/webui/storage/test_provider.py b/backend/open_webui/test/apps/webui/storage/test_provider.py new file mode 100644 index 000000000..d4d66c973 --- /dev/null +++ b/backend/open_webui/test/apps/webui/storage/test_provider.py @@ -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")