(app: App)
| 516 | sys.version_info < (3, 12), reason="TypeAlias requires Python 3.12 or higher" |
| 517 | ) |
| 518 | async def test_aliased_state(app: App): |
| 519 | from python_3_12.plugins.aliased_param.param_state import aliased_state |
| 520 | |
| 521 | fake_message = FakeMessage("text") |
| 522 | fake_matched = re.match(r"\[cq:(?P<type>.*?),(?P<arg>.*?)\]", "[cq:test,arg=value]") |
| 523 | fake_state = { |
| 524 | PREFIX_KEY: { |
| 525 | CMD_KEY: ("cmd",), |
| 526 | RAW_CMD_KEY: "/cmd", |
| 527 | CMD_START_KEY: "/", |
| 528 | CMD_ARG_KEY: fake_message, |
| 529 | CMD_WHITESPACE_KEY: " ", |
| 530 | }, |
| 531 | SHELL_ARGV: ["-h"], |
| 532 | SHELL_ARGS: {"help": True}, |
| 533 | REGEX_MATCHED: fake_matched, |
| 534 | STARTSWITH_KEY: "startswith", |
| 535 | ENDSWITH_KEY: "endswith", |
| 536 | FULLMATCH_KEY: "fullmatch", |
| 537 | KEYWORD_KEY: "keyword", |
| 538 | } |
| 539 | |
| 540 | async with app.test_dependent(aliased_state, allow_types=[StateParam]) as ctx: |
| 541 | ctx.pass_params(state=fake_state) |
| 542 | ctx.should_return(fake_state) |
| 543 | |
| 544 | |
| 545 | @pytest.mark.anyio |
nothing calls this directly
no test coverage detected