Tests for prepare_inputs method.
| 165 | |
| 166 | |
| 167 | class TestBaseAPIPrepareInputs: |
| 168 | """Tests for prepare_inputs method.""" |
| 169 | |
| 170 | def test_prepare_inputs_text(self, api): |
| 171 | """Test preparing text-only inputs.""" |
| 172 | inputs = [{"type": "text", "value": "Hello world"}] |
| 173 | result, text = api.prepare_inputs(inputs) |
| 174 | assert isinstance(result, list) |
| 175 | assert len(result) == 1 |
| 176 | assert result[0]["role"] == "user" |
| 177 | |
| 178 | def test_prepare_inputs_with_image(self, api, real_image): |
| 179 | """Test preparing inputs with image.""" |
| 180 | inputs = [ |
| 181 | {"type": "text", "value": "Describe this image"}, |
| 182 | {"type": "image", "value": real_image}, |
| 183 | ] |
| 184 | result, text = api.prepare_inputs(inputs) |
| 185 | assert isinstance(result, list) |
| 186 | |
| 187 | |
| 188 | class TestBaseAPIGenerate: |
nothing calls this directly
no outgoing calls
no test coverage detected