Skip to content

Commit 4510855

Browse files
committed
format update
1 parent 26fa8f3 commit 4510855

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

tests/prompts/test_prompt_integration.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,40 @@
33
import pytest
44
from arxiv_mcp_server.prompts.handlers import list_prompts, get_prompt
55

6+
67
@pytest.mark.asyncio
78
async def test_server_list_prompts():
89
"""Test server list_prompts endpoint."""
910
prompts = await list_prompts()
1011
assert len(prompts) == 1
11-
12+
1213
# Check that all prompts have required fields
1314
for prompt in prompts:
1415
assert prompt.name
1516
assert prompt.description
1617
assert prompt.arguments is not None
1718

19+
1820
@pytest.mark.asyncio
1921
async def test_server_get_analysis_prompt():
2022
"""Test server get_prompt endpoint with analysis prompt."""
21-
result = await get_prompt(
22-
"deep-paper-analysis",
23-
{"paper_id": "2401.00123"}
24-
)
25-
23+
result = await get_prompt("deep-paper-analysis", {"paper_id": "2401.00123"})
24+
2625
assert len(result.messages) == 1
2726
message = result.messages[0]
2827
assert message.role == "user"
2928
assert "2401.00123" in message.content.text
3029

30+
3131
@pytest.mark.asyncio
3232
async def test_server_get_prompt_invalid_name():
3333
"""Test server get_prompt endpoint with invalid prompt name."""
3434
with pytest.raises(ValueError, match="Prompt not found"):
3535
await get_prompt("invalid-prompt", {})
3636

37+
3738
@pytest.mark.asyncio
3839
async def test_server_get_prompt_missing_args():
3940
"""Test server get_prompt endpoint with missing required arguments."""
4041
with pytest.raises(ValueError, match="Missing required argument"):
41-
await get_prompt("deep-paper-analysis", {})
42+
await get_prompt("deep-paper-analysis", {})

tests/prompts/test_prompts.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,49 @@
55
from arxiv_mcp_server.prompts.handlers import list_prompts, get_prompt
66
from mcp.types import GetPromptResult, PromptMessage, TextContent
77

8+
89
@pytest.mark.asyncio
910
async def test_list_prompts():
1011
"""Test listing available prompts."""
1112
prompts = await list_prompts()
1213
assert len(prompts) == 1
13-
14+
1415
prompt_names = {p.name for p in prompts}
1516
expected_names = {"deep-paper-analysis"}
1617
assert prompt_names == expected_names
1718

19+
1820
@pytest.mark.asyncio
1921
async def test_get_paper_analysis_prompt():
2022
"""Test getting paper analysis prompt."""
21-
result = await get_prompt(
22-
"deep-paper-analysis",
23-
{"paper_id": "2401.00123"}
24-
)
25-
23+
result = await get_prompt("deep-paper-analysis", {"paper_id": "2401.00123"})
24+
2625
assert isinstance(result, GetPromptResult)
2726
assert len(result.messages) == 1
2827
message = result.messages[0]
29-
28+
3029
assert isinstance(message, PromptMessage)
3130
assert message.role == "user"
3231
assert isinstance(message.content, TextContent)
3332
assert "2401.00123" in message.content.text
3433

34+
3535
@pytest.mark.asyncio
3636
async def test_get_prompt_with_invalid_name():
3737
"""Test getting prompt with invalid name."""
3838
with pytest.raises(ValueError, match="Prompt not found"):
3939
await get_prompt("invalid-prompt", {})
4040

41+
4142
@pytest.mark.asyncio
4243
async def test_get_prompt_with_no_arguments():
4344
"""Test getting prompt with no arguments."""
4445
with pytest.raises(ValueError, match="No arguments provided"):
4546
await get_prompt("deep-paper-analysis", None)
4647

48+
4749
@pytest.mark.asyncio
4850
async def test_get_prompt_with_missing_required_argument():
4951
"""Test getting prompt with missing required argument."""
5052
with pytest.raises(ValueError, match="Missing required argument"):
51-
await get_prompt("deep-paper-analysis", {})
53+
await get_prompt("deep-paper-analysis", {})

0 commit comments

Comments
 (0)