def test_convert_tool_to_dashscope_format(dashscope_llm):
    """Test _convert_tool_to_dashscope_format correctly converts a tool to the DashScope format."""
    result = dashscope_llm._convert_tool_to_dashscope_format(DummyTool())

    expected = {
        "type": "function",
        "function": {
            "name": "dummy_tool",
            "description": "A dummy tool for testing.",
            "parameters": {
                "type": "object",
                "properties": {
                    "param1": {"type": "string", "description": "A test parameter."}
                },
            },
            "required": ["param1"],
        },
    }

    assert result == expected, f"Expected {expected}, but got {result}"
Test _convert_tool_to_dashscope_format correctly converts a tool to the DashScope format.
llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_dashscope.py