Skip to content

Commit 0e67522

Browse files
committed
Fix some tests
1 parent 73ba6a3 commit 0e67522

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

tests/test_async_dispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ async def ping() -> Result:
9797
context=NOCONTEXT,
9898
methods={"ping": ping},
9999
request='{"jsonrpc": "2.0", "method": "ping", "id": 1}',
100-
) == Failure(ErrorResponse(ERROR_SERVER_ERROR, "Server error", "ping", None))
100+
) == Failure(ErrorResponse(ERROR_SERVER_ERROR, "Server error", "foo", None))

tests/test_dispatcher.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,25 @@ def f() -> Result:
167167

168168

169169
def test_validate_result_positionals() -> None:
170-
def f(_: int) -> Result:
170+
def ping_(_: int) -> Result:
171171
return Ok()
172172

173-
assert validate_args(Request("f", [1], NOID), NOCONTEXT, f) == Success(f)
173+
assert validate_args(Request("ping_", [1], NOID), NOCONTEXT, ping_) == Success(
174+
ping_
175+
)
174176

175177

176178
def test_validate_result_positionals_not_passed() -> None:
177-
def f(_: str) -> Result:
179+
def ping_(name: str) -> Result:
178180
return Ok()
179181

180-
assert validate_args(Request("f", {"foo": "bar"}, NOID), NOCONTEXT, f) == Failure(
182+
assert validate_args(
183+
Request("ping_", {"foo": "bar"}, NOID), NOCONTEXT, ping_
184+
) == Failure(
181185
ErrorResult(
182-
ERROR_INVALID_PARAMS, "Invalid params", "missing a required argument: 'x'"
186+
ERROR_INVALID_PARAMS,
187+
"Invalid params",
188+
"missing a required argument: 'name'",
183189
)
184190
)
185191

0 commit comments

Comments
 (0)