(
cmds: tuple[tuple[str, ...]],
force_whitespace: str | bool | None,
cmd: tuple[str, ...],
whitespace: str | None,
arg_text: str | None,
expected: bool,
)
| 322 | ], |
| 323 | ) |
| 324 | async def test_command( |
| 325 | cmds: tuple[tuple[str, ...]], |
| 326 | force_whitespace: str | bool | None, |
| 327 | cmd: tuple[str, ...], |
| 328 | whitespace: str | None, |
| 329 | arg_text: str | None, |
| 330 | expected: bool, |
| 331 | ): |
| 332 | test_command = command(*cmds, force_whitespace=force_whitespace) |
| 333 | dependent = next(iter(test_command.checkers)) |
| 334 | checker = dependent.call |
| 335 | |
| 336 | assert isinstance(checker, CommandRule) |
| 337 | assert checker.cmds == cmds |
| 338 | |
| 339 | arg = arg_text if arg_text is None else FakeMessage(arg_text) |
| 340 | state = { |
| 341 | PREFIX_KEY: {CMD_KEY: cmd, CMD_WHITESPACE_KEY: whitespace, CMD_ARG_KEY: arg} |
| 342 | } |
| 343 | assert await dependent(state=state) == expected |
| 344 | |
| 345 | |
| 346 | @pytest.mark.anyio |
nothing calls this directly
no test coverage detected