diff options
Diffstat (limited to 'etc/unittest/backend.py')
-rw-r--r-- | etc/unittest/backend.py | 14 |
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): |