summaryrefslogtreecommitdiffstats
path: root/etc/unittest/mocks.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-21 09:37:35 +0100
committerGitHub <noreply@github.com>2024-01-21 09:37:35 +0100
commitfea4f546a7fb7c7af5a3da2247b5ea966e179f08 (patch)
tree59266fc31ec6df5fa53ef97b22f024f2f3f339f8 /etc/unittest/mocks.py
parentMerge pull request #1484 from hlohaus/copilot (diff)
parentUpdate workflow (diff)
downloadgpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.gz
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.bz2
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.lz
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.xz
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.tar.zst
gpt4free-fea4f546a7fb7c7af5a3da2247b5ea966e179f08.zip
Diffstat (limited to 'etc/unittest/mocks.py')
-rw-r--r--etc/unittest/mocks.py25
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