Skip to content

Commit d1cc2b0

Browse files
test(mcp): add fixture for claude remote setup
1 parent 904f22b commit d1cc2b0

2 files changed

Lines changed: 120 additions & 2 deletions

File tree

tests/regression/mcp/test_claude_transport_serialization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class TestClaudeTransportSerialization:
3838
@pytest.mark.parametrize(
3939
"test_case",
4040
FIXTURES["remote_http"],
41-
ids=lambda tc: tc["host"],
41+
ids=lambda tc: f'{tc["host"]}-{tc["case"]}',
4242
)
4343
@regression_test
4444
def test_remote_url_defaults_to_http_type(self, test_case):
@@ -53,7 +53,7 @@ def test_remote_url_defaults_to_http_type(self, test_case):
5353
@pytest.mark.parametrize(
5454
"test_case",
5555
FIXTURES["stdio_without_type"],
56-
ids=lambda tc: tc["host"],
56+
ids=lambda tc: f'{tc["host"]}-{tc["case"]}',
5757
)
5858
@regression_test
5959
def test_stdio_config_does_not_require_type_input(self, test_case):
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"remote_http": [
3+
{
4+
"case": "input_type_omitted",
5+
"host": "claude-desktop",
6+
"config": {
7+
"name": "remote-server",
8+
"url": "https://api.example.com/mcp",
9+
"headers": {
10+
"Authorization": "Bearer token"
11+
}
12+
},
13+
"expected": {
14+
"url": "https://api.example.com/mcp",
15+
"headers": {
16+
"Authorization": "Bearer token"
17+
},
18+
"type": "http"
19+
}
20+
},
21+
{
22+
"case": "input_type_omitted",
23+
"host": "claude-code",
24+
"config": {
25+
"name": "remote-server",
26+
"url": "https://api.example.com/mcp",
27+
"headers": {
28+
"Authorization": "Bearer token"
29+
}
30+
},
31+
"expected": {
32+
"url": "https://api.example.com/mcp",
33+
"headers": {
34+
"Authorization": "Bearer token"
35+
},
36+
"type": "http"
37+
}
38+
},
39+
{
40+
"case": "input_type_sse",
41+
"host": "claude-desktop",
42+
"config": {
43+
"name": "remote-server",
44+
"url": "https://api.example.com/mcp",
45+
"headers": {
46+
"Authorization": "Bearer token"
47+
},
48+
"type": "sse"
49+
},
50+
"expected": {
51+
"url": "https://api.example.com/mcp",
52+
"headers": {
53+
"Authorization": "Bearer token"
54+
},
55+
"type": "http"
56+
}
57+
},
58+
{
59+
"case": "input_type_sse",
60+
"host": "claude-code",
61+
"config": {
62+
"name": "remote-server",
63+
"url": "https://api.example.com/mcp",
64+
"headers": {
65+
"Authorization": "Bearer token"
66+
},
67+
"type": "sse"
68+
},
69+
"expected": {
70+
"url": "https://api.example.com/mcp",
71+
"headers": {
72+
"Authorization": "Bearer token"
73+
},
74+
"type": "http"
75+
}
76+
}
77+
],
78+
"stdio_without_type": [
79+
{
80+
"case": "input_type_omitted",
81+
"host": "claude-desktop",
82+
"config": {
83+
"name": "stdio-server",
84+
"command": "python",
85+
"args": ["-m", "mcp_server"],
86+
"env": {
87+
"API_KEY": "secret"
88+
}
89+
},
90+
"expected": {
91+
"command": "python",
92+
"args": ["-m", "mcp_server"],
93+
"env": {
94+
"API_KEY": "secret"
95+
}
96+
}
97+
},
98+
{
99+
"case": "input_type_omitted",
100+
"host": "claude-code",
101+
"config": {
102+
"name": "stdio-server",
103+
"command": "python",
104+
"args": ["-m", "mcp_server"],
105+
"env": {
106+
"API_KEY": "secret"
107+
}
108+
},
109+
"expected": {
110+
"command": "python",
111+
"args": ["-m", "mcp_server"],
112+
"env": {
113+
"API_KEY": "secret"
114+
}
115+
}
116+
}
117+
]
118+
}

0 commit comments

Comments
 (0)