aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tests/test_injector.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_injector.py')
-rw-r--r--tests/test_injector.py16
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()