diff options
| author | 2024-03-31 22:08:49 +0800 | |
|---|---|---|
| committer | 2024-03-31 22:08:49 +0800 | |
| commit | 50bbfe4ce91117ee88d6020fe194e7cd14d41f4e (patch) | |
| tree | f5c57920773f92e27c4a1669ee755bc2edbacdcb /tests/test_injector.py | |
| parent | b5c4f42b676cc4077354d06bdf325f276d256667 (diff) | |
| download | infini-50bbfe4ce91117ee88d6020fe194e7cd14d41f4e.tar.gz infini-50bbfe4ce91117ee88d6020fe194e7cd14d41f4e.zip | |
fix(injector): fix injector error when subscrib annocation found
Diffstat (limited to 'tests/test_injector.py')
| -rw-r--r-- | tests/test_injector.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/test_injector.py b/tests/test_injector.py index ccd040ba..c41dd732 100644 --- a/tests/test_injector.py +++ b/tests/test_injector.py @@ -22,25 +22,30 @@ def test_injector(): def test_handler_injector(): input = Input("test_message") - def absolute(input: Input, plain_text: str) -> Output: + def absolute(input: Input[str], plain_text: str) -> Output: return input.output( "text", - plain_text, - status=0, + "absolute", block=False, + variables={ + "text": plain_text, + }, ) handler = Handler() handler.handlers = [ { "priority": 2, - "router": Startswith(".add"), + "router": Startswith(""), "handler": absolute, }, ] core = Loader().into_core() core.handler = handler + core.generator.events = { + "absolute": "{{ text }}", + } for output in core.input(input): assert output == "test_message" |
