diff options
| author | 2024-04-01 11:06:17 +0800 | |
|---|---|---|
| committer | 2024-04-01 11:06:17 +0800 | |
| commit | 8821abdfd1e69aa065dd38eba81c8e29618ea8a2 (patch) | |
| tree | 57b8475ffd153410e2a336b9511437ea3adb8398 /tests/test_injector.py | |
| parent | a81364221c55528910cbe8932041c4b0ea3b10d2 (diff) | |
| download | infini-2.1.11.tar.gz infini-2.1.11.zip | |
fix(injector): fix injector error when complex subscrib annocationv2.1.11
Diffstat (limited to 'tests/test_injector.py')
| -rw-r--r-- | tests/test_injector.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_injector.py b/tests/test_injector.py index c41dd732..819810e1 100644 --- a/tests/test_injector.py +++ b/tests/test_injector.py @@ -1,3 +1,4 @@ +from typing import Optional from infini.handler import Handler from infini.injector import Injector from infini.input import Input @@ -31,6 +32,16 @@ def test_handler_injector(): "text": plain_text, }, ) + + def absolute_2(input: Input[str], plain_text: Optional[str]) -> Output: + return input.output( + "text", + "absolute", + block=False, + variables={ + "text": plain_text, + }, + ) handler = Handler() handler.handlers = [ @@ -39,6 +50,11 @@ def test_handler_injector(): "router": Startswith(""), "handler": absolute, }, + { + "priority": 2, + "router": Startswith(""), + "handler": absolute_2, + }, ] core = Loader().into_core() |
