Tests for pre_process method.
| 224 | |
| 225 | |
| 226 | class TestBaseAPIPreProcess: |
| 227 | """Tests for pre_process method.""" |
| 228 | |
| 229 | def test_pre_process_text_message(self, api): |
| 230 | """Test preprocessing text message.""" |
| 231 | result = api.pre_process("Hello world") |
| 232 | assert isinstance(result, list) |
| 233 | assert len(result) == 1 |
| 234 | assert result[0]["role"] == "user" |
| 235 | |
| 236 | def test_pre_process_list_dict_message(self, api): |
| 237 | """Test preprocessing list of dict message.""" |
| 238 | msg = [{"type": "text", "value": "Hello"}] |
| 239 | result = api.pre_process(msg) |
| 240 | assert isinstance(result, list) |
| 241 | |
| 242 | |
| 243 | class TestBaseAPIShutdown: |
nothing calls this directly
no outgoing calls
no test coverage detected