summaryrefslogtreecommitdiffstats
path: root/etc/unittest/backend.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-22 00:16:58 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-02-22 00:16:58 +0100
commite5b7f72b719814ffa2748e8e8ed1c6713a24e1a6 (patch)
tree70e9f87cb18f165428492d53a1c6e28c0828490a /etc/unittest/backend.py
parentUpdate docs / readme, Improve Gemini auth (diff)
downloadgpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.gz
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.bz2
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.lz
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.xz
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.tar.zst
gpt4free-e5b7f72b719814ffa2748e8e8ed1c6713a24e1a6.zip
Diffstat (limited to 'etc/unittest/backend.py')
-rw-r--r--etc/unittest/backend.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/etc/unittest/backend.py b/etc/unittest/backend.py
index e4a7b3ab..846c3554 100644
--- a/etc/unittest/backend.py
+++ b/etc/unittest/backend.py
@@ -1,9 +1,11 @@
import unittest
+# import asyncio
from unittest.mock import MagicMock
from .mocks import ProviderMock
import g4f
try:
from g4f.gui.server.backend import Backend_Api, get_error_message
+ # from g4f.gui.server.internet import search
has_requirements = True
except:
has_requirements = False
@@ -16,10 +18,10 @@ class TestBackendApi(unittest.TestCase):
self.app = MagicMock()
self.api = Backend_Api(self.app)
- def test_version(self):
- response = self.api.get_version()
- self.assertIn("version", response)
- self.assertIn("latest_version", response)
+ # def test_version(self):
+ # response = self.api.get_version()
+ # self.assertIn("version", response)
+ # self.assertIn("latest_version", response)
def test_get_models(self):
response = self.api.get_models()
@@ -31,6 +33,10 @@ class TestBackendApi(unittest.TestCase):
self.assertIsInstance(response, list)
self.assertTrue(len(response) > 0)
+ # def test_search(self):
+ # result = asyncio.run(search("Hello"))
+ # self.assertEqual(5, len(result))
+
class TestUtilityFunctions(unittest.TestCase):
def setUp(self):