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.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_injector.py b/tests/test_injector.py
new file mode 100644
index 00000000..0d320a2c
--- /dev/null
+++ b/tests/test_injector.py
@@ -0,0 +1,11 @@
+from infini.injector import Injector
+
+
+def test_injector():
+ def add(a: int, b: int = 0):
+ return a + b
+
+ injector = Injector()
+ injector.parameters = {"a": 12, "b": 20, "c": 0}
+ assert injector.inject(add)() == 32
+ assert injector.output(add) == 32