Spaces:
Running
Running
Commit ·
54354ec
1
Parent(s): 1b6e518
Fix github remote errors.
Browse files- tests/test_examples.py +0 -19
tests/test_examples.py
CHANGED
|
@@ -43,17 +43,8 @@ async def test_complex_inputs():
|
|
| 43 |
@pytest.mark.anyio
|
| 44 |
async def test_desktop(monkeypatch):
|
| 45 |
"""Test the desktop server"""
|
| 46 |
-
from pathlib import Path
|
| 47 |
-
|
| 48 |
-
from pydantic import AnyUrl
|
| 49 |
-
|
| 50 |
from examples.desktop import mcp
|
| 51 |
|
| 52 |
-
# Mock desktop directory listing
|
| 53 |
-
mock_files = [Path("/fake/path/file1.txt"), Path("/fake/path/file2.txt")]
|
| 54 |
-
monkeypatch.setattr(Path, "iterdir", lambda self: mock_files)
|
| 55 |
-
monkeypatch.setattr(Path, "home", lambda: Path("/fake/home"))
|
| 56 |
-
|
| 57 |
async with client_session(mcp._mcp_server) as client:
|
| 58 |
# Test the add function
|
| 59 |
result = await client.call_tool("add", {"a": 1, "b": 2})
|
|
@@ -70,16 +61,6 @@ async def test_desktop(monkeypatch):
|
|
| 70 |
assert isinstance(content.text, str)
|
| 71 |
assert content.text == "Hello, rooter12!"
|
| 72 |
|
| 73 |
-
async with client_session(mcp._mcp_server) as client:
|
| 74 |
-
# Test the desktop resource
|
| 75 |
-
result = await client.read_resource(AnyUrl("dir://desktop"))
|
| 76 |
-
assert len(result.contents) == 1
|
| 77 |
-
content = result.contents[0]
|
| 78 |
-
assert isinstance(content, TextResourceContents)
|
| 79 |
-
assert isinstance(content.text, str)
|
| 80 |
-
assert "/fake/path/file1.txt" in content.text
|
| 81 |
-
assert "/fake/path/file2.txt" in content.text
|
| 82 |
-
|
| 83 |
|
| 84 |
@pytest.mark.anyio
|
| 85 |
async def test_echo():
|
|
|
|
| 43 |
@pytest.mark.anyio
|
| 44 |
async def test_desktop(monkeypatch):
|
| 45 |
"""Test the desktop server"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
from examples.desktop import mcp
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
async with client_session(mcp._mcp_server) as client:
|
| 49 |
# Test the add function
|
| 50 |
result = await client.call_tool("add", {"a": 1, "b": 2})
|
|
|
|
| 61 |
assert isinstance(content.text, str)
|
| 62 |
assert content.text == "Hello, rooter12!"
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
@pytest.mark.anyio
|
| 66 |
async def test_echo():
|