Tests for preproc_content method.
| 139 | |
| 140 | |
| 141 | class TestBaseAPIPreprocContent: |
| 142 | """Tests for preproc_content method.""" |
| 143 | |
| 144 | def test_preproc_content_simple_text(self, api): |
| 145 | """Test preprocessing simple text.""" |
| 146 | result = api.preproc_content("Hello world") |
| 147 | assert isinstance(result, list) |
| 148 | assert len(result) == 1 |
| 149 | assert result[0]["type"] == "text" |
| 150 | assert result[0]["value"] == "Hello world" |
| 151 | |
| 152 | def test_preproc_content_dict_input(self, api): |
| 153 | """Test preprocessing dict input.""" |
| 154 | inputs = {"type": "text", "value": "Hello"} |
| 155 | result = api.preproc_content(inputs) |
| 156 | assert isinstance(result, list) |
| 157 | assert len(result) == 1 |
| 158 | |
| 159 | def test_preproc_content_list_str_input(self, api): |
| 160 | """Test preprocessing list of strings.""" |
| 161 | inputs = ["Hello", "World"] |
| 162 | result = api.preproc_content(inputs) |
| 163 | assert isinstance(result, list) |
| 164 | assert len(result) == 2 |
| 165 | |
| 166 | |
| 167 | class TestBaseAPIPrepareInputs: |
nothing calls this directly
no outgoing calls
no test coverage detected