New minimum requirements (#1515)

* New minimum requirements
* Add ConversationStyleOptionSets to Bing
* Add image.ImageRequest
* Improve python version support
* Improve unittests
This commit is contained in:
H Lohaus
2024-01-26 07:54:13 +01:00
committed by GitHub
parent 71d71b6512
commit feb83c168b
35 changed files with 471 additions and 284 deletions

View File

@@ -3,11 +3,17 @@ import unittest
from unittest.mock import MagicMock
from .mocks import ProviderMock
import g4f
from g4f.gui.server.backend import Backend_Api, get_error_message
try:
from g4f.gui.server.backend import Backend_Api, get_error_message
has_requirements = True
except:
has_requirements = False
class TestBackendApi(unittest.TestCase):
def setUp(self):
if not has_requirements:
self.skipTest('"flask" not installed')
self.app = MagicMock()
self.api = Backend_Api(self.app)
@@ -28,6 +34,10 @@ class TestBackendApi(unittest.TestCase):
class TestUtilityFunctions(unittest.TestCase):
def setUp(self):
if not has_requirements:
self.skipTest('"flask" not installed')
def test_get_error_message(self):
g4f.debug.last_provider = ProviderMock
exception = Exception("Message")