mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-10 06:18:39 +03:00
refactor: enforce BasedPyright strict type checking (#5158)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from inspect import Parameter, signature
|
||||
from unittest.mock import AsyncMock, MagicMock
|
||||
|
||||
import pytest
|
||||
@@ -13,6 +14,13 @@ from nanobot.command.builtin import (
|
||||
from nanobot.command.router import CommandContext, CommandRouter
|
||||
|
||||
|
||||
def test_command_context_requires_loop_as_keyword_dependency() -> None:
|
||||
loop_parameter = signature(CommandContext).parameters["loop"]
|
||||
|
||||
assert loop_parameter.kind is Parameter.KEYWORD_ONLY
|
||||
assert loop_parameter.default is Parameter.empty
|
||||
|
||||
|
||||
class TestIsDispatchableCommand:
|
||||
"""Unit tests for the is_dispatchable_command() predicate."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user