async def test_embed_many_with_some_empty(self, mock_post, model):
        """Test embedding of a mix of empty and non-empty texts."""
        # Mock response
        mock_response = MagicMock()
        mock_response.raise_for_status = AsyncMock()
        mock_response.json.return_value = {"vectors": [[0.1, 0.2, 0.3] * 128]}
        mock_post.return_value = mock_response

        texts = ["", "Text 2"]
        result = await model.embed_many(texts)

        # Verify the result
        assert isinstance(result, list)
        assert len(result) == 2
        assert all(len(vec) == 384 for vec in result)
        assert all(v == 0.0 for v in result[0])  # First vector should be all zeros

        # Verify the API call
        mock_post.assert_called_once_with(
            f"{model.inference_url}/vectors/",
            json={"text": "Text 2"},  # Only non-empty text should be sent
        )
Test embedding of a mix of empty and non-empty texts.
backend/tests/platform/embedding_models/test_local_text2vec.py