MCPcopy Create free account
hub / github.com/Open-Bee/DataStudio / TestBaseAPIGenerate

Class TestBaseAPIGenerate

tests/models/test_base_api.py:188–214  ·  view source on GitHub ↗

Tests for generate method.

Source from the content-addressed store, hash-verified

186
187
188class TestBaseAPIGenerate:
189 """Tests for generate method."""
190
191 def test_generate_single_message(self, api):
192 """Test generating response for single message."""
193 messages = ["Hello"]
194 results = api.generate(messages)
195 assert isinstance(results, list)
196 assert len(results) == 1
197
198 def test_generate_multiple_messages(self, api):
199 """Test generating responses for multiple messages."""
200 messages = ["Hello", "World"]
201 results = api.generate(messages)
202 assert isinstance(results, list)
203 assert len(results) == 2
204
205 def test_generate_with_kwargs(self, api):
206 """Test generating with additional kwargs."""
207 messages = ["Hello"]
208 results = api.generate(messages, temperature=0.5)
209 assert isinstance(results, list)
210
211 def test_generate_empty_messages(self, api):
212 """Test generating with empty messages list."""
213 results = api.generate([])
214 assert results == []
215
216
217class TestBaseAPIProcessSingleMessage:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected