mirror of
https://github.com/open-webui/open-webui
synced 2025-01-19 09:16:44 +00:00
Add test classes for the providers
This commit is contained in:
parent
535e59af8d
commit
3aa28de5f1
@ -16,3 +16,37 @@ def test_get_storage_provider():
|
|||||||
assert isinstance(Storage, provider.S3StorageProvider)
|
assert isinstance(Storage, provider.S3StorageProvider)
|
||||||
with pytest.raises(RuntimeError):
|
with pytest.raises(RuntimeError):
|
||||||
provider.get_storage_provider("invalid")
|
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
|
||||||
|
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user