Format files with ruff (#562)
This commit is contained in:
parent
babb477dff
commit
b4c7db6a50
2 changed files with 3 additions and 6 deletions
|
|
@ -466,6 +466,7 @@ class FastMCP:
|
||||||
async def run_sse_async(self) -> None:
|
async def run_sse_async(self) -> None:
|
||||||
"""Run the server using SSE transport."""
|
"""Run the server using SSE transport."""
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|
||||||
starlette_app = self.sse_app()
|
starlette_app = self.sse_app()
|
||||||
|
|
||||||
config = uvicorn.Config(
|
config = uvicorn.Config(
|
||||||
|
|
|
||||||
|
|
@ -114,17 +114,13 @@ async def test_read_resource_file(mcp: FastMCP):
|
||||||
|
|
||||||
@pytest.mark.anyio
|
@pytest.mark.anyio
|
||||||
async def test_delete_file(mcp: FastMCP, test_dir: Path):
|
async def test_delete_file(mcp: FastMCP, test_dir: Path):
|
||||||
await mcp.call_tool(
|
await mcp.call_tool("delete_file", arguments={"path": str(test_dir / "example.py")})
|
||||||
"delete_file", arguments={"path": str(test_dir / "example.py")}
|
|
||||||
)
|
|
||||||
assert not (test_dir / "example.py").exists()
|
assert not (test_dir / "example.py").exists()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.anyio
|
@pytest.mark.anyio
|
||||||
async def test_delete_file_and_check_resources(mcp: FastMCP, test_dir: Path):
|
async def test_delete_file_and_check_resources(mcp: FastMCP, test_dir: Path):
|
||||||
await mcp.call_tool(
|
await mcp.call_tool("delete_file", arguments={"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_iter = await mcp.read_resource("file://test_dir/example.py")
|
||||||
res_list = list(res_iter)
|
res_list = list(res_iter)
|
||||||
assert len(res_list) == 1
|
assert len(res_list) == 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue