mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-23 08:44:22 +01:00
Python lint: Ruff rules for comprehensions and performance (#512)
This commit is contained in:
@@ -38,7 +38,7 @@ class TestRenderPrompt:
|
||||
return f"Hello, {name}! You're {age} years old."
|
||||
|
||||
prompt = Prompt.from_function(fn)
|
||||
assert await prompt.render(arguments=dict(name="World")) == [
|
||||
assert await prompt.render(arguments={"name": "World"}) == [
|
||||
UserMessage(
|
||||
content=TextContent(
|
||||
type="text", text="Hello, World! You're 30 years old."
|
||||
@@ -53,7 +53,7 @@ class TestRenderPrompt:
|
||||
|
||||
prompt = Prompt.from_function(fn)
|
||||
with pytest.raises(ValueError):
|
||||
await prompt.render(arguments=dict(age=40))
|
||||
await prompt.render(arguments={"age": 40})
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_fn_returns_message(self):
|
||||
|
||||
@@ -115,7 +115,7 @@ async def test_read_resource_file(mcp: FastMCP):
|
||||
@pytest.mark.anyio
|
||||
async def test_delete_file(mcp: FastMCP, test_dir: Path):
|
||||
await mcp.call_tool(
|
||||
"delete_file", arguments=dict(path=str(test_dir / "example.py"))
|
||||
"delete_file", arguments={"path": str(test_dir / "example.py")}
|
||||
)
|
||||
assert not (test_dir / "example.py").exists()
|
||||
|
||||
@@ -123,7 +123,7 @@ async def test_delete_file(mcp: FastMCP, test_dir: Path):
|
||||
@pytest.mark.anyio
|
||||
async def test_delete_file_and_check_resources(mcp: FastMCP, test_dir: Path):
|
||||
await mcp.call_tool(
|
||||
"delete_file", arguments=dict(path=str(test_dir / "example.py"))
|
||||
"delete_file", arguments={"path": str(test_dir / "example.py")}
|
||||
)
|
||||
res_iter = await mcp.read_resource("file://test_dir/example.py")
|
||||
res_list = list(res_iter)
|
||||
|
||||
Reference in New Issue
Block a user