async def test_stream_success(self):
        """Ensures that _stream yields parsed lines on success."""
        payload = {"prompt": "Hello"}
        response_mock = MagicMock()
        response_mock.status_code = 200
        response_mock.raise_for_status = Mock()
        response_mock.aiter_lines.return_value = self.async_iter(
            ['data: {"key": "value1"}', 'data: {"key": "value2"}', "[DONE]"]
        )

        # Define an async context manager
        @asynccontextmanager
        async def stream_context_manager(*args, **kwargs):
            yield response_mock

        # Mock the stream method to return our context manager
        self.client._client.stream = Mock(side_effect=stream_context_manager)

        result = []
        async for item in self.client._stream(payload):
            result.append(item)

        assert result == [{"key": "value1"}, {"key": "value2"}]
Ensures that _stream yields parsed lines on success.
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_oci_data_science_client.py