@@ -141,11 +141,11 @@ def test_route_chatbot(self):
141
141
except Exception as e :
142
142
self .fail (f"Failed to create chatbot model { chatbot_model1 } : { e } " )
143
143
144
- def test_route_chatbot_error (self ):
144
+ def test_route_chatbot_undefined (self ):
145
145
chatbot_model = 'openai: invalid_model_name'
146
- with self . assertLogs ( level = 'WARNING' ) as cm :
147
- route_chatbot ( chatbot_model + 'error' )
148
- self .assertIn ( 'not found in predefined models' , cm . output [ 0 ] )
146
+ model_cls , model_name = route_chatbot ( chatbot_model )
147
+ self . assertEqual ( model_cls , GPTBot )
148
+ self .assertEqual ( model_name , chatbot_model . split ( ':' )[ - 1 ]. strip () )
149
149
150
150
def test_temperature_clamp (self ):
151
151
chatbot1 = GPTBot (temperature = 10 , top_p = 1 , retry = 8 , max_async = 16 )
@@ -174,15 +174,15 @@ def test_non_beta_base_url(self):
174
174
# TODO: Retry_bot testing
175
175
176
176
class TestGeminiBot (unittest .TestCase ):
177
- # def setUp(self):
178
- # import os
179
- # os.environ['HTTP_PROXY'] = 'http://127.0.0.1:7890 '
180
- # os.environ['HTTPS_PROXY'] = 'http://127.0.0.1:7890 '
181
- #
182
- # def tearDown(self):
183
- # import os
184
- # os.environ.pop('HTTP_PROXY')
185
- # os.environ.pop('HTTPS_PROXY')
177
+ def setUp (self ):
178
+ import os
179
+ os .environ ['HTTP_PROXY' ] = 'http://127.0.0.1:7897 '
180
+ os .environ ['HTTPS_PROXY' ] = 'http://127.0.0.1:7897 '
181
+
182
+ def tearDown (self ):
183
+ import os
184
+ os .environ .pop ('HTTP_PROXY' )
185
+ os .environ .pop ('HTTPS_PROXY' )
186
186
187
187
def test_multi_turn (self ):
188
188
bot = GeminiBot ()
0 commit comments