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.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_injector.py b/tests/test_injector.py
index e6ae2e56..d6c6d3e8 100644
--- a/tests/test_injector.py
+++ b/tests/test_injector.py
@@ -9,16 +9,17 @@ from infini.router import Startswith
def test_injector():
- def name(name: str):
- return name
+ def name(nickname: str, c: int = 0):
+ return nickname, c
def add(a: int, b: int = 0):
return a + b
injector = Injector()
- injector.parameters = {"a": 12, "b": 20, "c": 0, "card_name": name}
+ injector.parameters = {"a": 12, "b": 20, "c": 10, "nickname": "苏向夜"}
assert injector.inject(add)() == 32
assert injector.output(add) == 32
+ assert injector.output(name) == ("苏向夜", 10)
def test_handler_injector():