summaryrefslogtreecommitdiffstats
path: root/etc/unittest/mocks.py
diff options
context:
space:
mode:
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