1 | from typing import Callable |
||
2 | |||
3 | from lagom import Container, FunctionCollection |
||
4 | |||
5 | |||
6 | def _func_a(input: str) -> str: |
||
7 | return f"func_a({input})" |
||
8 | |||
9 | |||
10 | def _func_b(input: str) -> str: |
||
11 | return f"func_b({input})" |
||
12 | |||
13 | |||
14 | SomeSignature = Callable[[str], str] |
||
15 | |||
16 | |||
17 | def test_a_function_collection_can_be_used_by_a_container( |
||
18 | container: Container, |
||
19 | ): |
||
20 | container[FunctionCollection[SomeSignature]] = FunctionCollection(_func_a, _func_b) |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
21 | assert container[FunctionCollection[SomeSignature]] == [_func_a, _func_b] |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
22 |