From 3aa28de5f168add8df7c6b879d5f3fd974bf744d Mon Sep 17 00:00:00 2001 From: Rodrigo Agundez Date: Thu, 16 Jan 2025 08:31:59 +0800 Subject: [PATCH] Add test classes for the providers --- .../test/apps/webui/storage/test_provider.py | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/backend/open_webui/test/apps/webui/storage/test_provider.py b/backend/open_webui/test/apps/webui/storage/test_provider.py index d4d66c973..8df07a9fb 100644 --- a/backend/open_webui/test/apps/webui/storage/test_provider.py +++ b/backend/open_webui/test/apps/webui/storage/test_provider.py @@ -16,3 +16,37 @@ def test_get_storage_provider(): assert isinstance(Storage, provider.S3StorageProvider) with pytest.raises(RuntimeError): provider.get_storage_provider("invalid") + +def test_class_instantiation(): + with pytest.raises(TypeError): + provider.StorageProvider() + with pytest.raises(TypeError): + class Test(provider.StorageProvider): + pass + Test() + provider.LocalStorageProvider() + provider.S3StorageProvider() + + +class TestLocalStorageProvider(provider.LocalStorageProvider): + def test_upload_file(self): + pass + def test_get_file(self): + pass + def test_delete_file(self): + pass + def test_delete_all_files(self): + pass + + +class TestLocalStorageProvider(provider.S3StorageProvider): + def test_upload_file(self): + pass + def test_get_file(self): + pass + def test_delete_file(self): + pass + def test_delete_all_files(self): + pass + +)