diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-01-21 02:20:23 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-01-21 02:20:23 +0100 |
commit | 9cbe9c1ccb2381e37402a36297f11a0f96b1b557 (patch) | |
tree | d5c8f96e7a5b774c1a8af923f8346e1633a3d1f3 /etc/unittest/mocks.py | |
parent | Fix permissions (diff) | |
download | gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.gz gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.bz2 gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.lz gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.xz gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.tar.zst gpt4free-9cbe9c1ccb2381e37402a36297f11a0f96b1b557.zip |
Diffstat (limited to '')
-rw-r--r-- | etc/unittest/mocks.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/etc/unittest/mocks.py b/etc/unittest/mocks.py new file mode 100644 index 00000000..a9505997 --- /dev/null +++ b/etc/unittest/mocks.py @@ -0,0 +1,25 @@ +from g4f.Provider.base_provider import AbstractProvider, AsyncProvider, AsyncGeneratorProvider + +class ProviderMock(AbstractProvider): + working = True + + def create_completion( + model, messages, stream, **kwargs + ): + yield "Mock" + +class AsyncProviderMock(AsyncProvider): + working = True + + async def create_async( + model, messages, **kwargs + ): + return "Mock" + +class AsyncGeneratorProviderMock(AsyncGeneratorProvider): + working = True + + async def create_async_generator( + model, messages, stream, **kwargs + ): + yield "Mock"
\ No newline at end of file |