tests.test_function_collections._func_a()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
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
The variable FunctionCollection does not seem to be defined.
Loading history...
21
    assert container[FunctionCollection[SomeSignature]] == [_func_a, _func_b]
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable SomeSignature does not seem to be defined.
Loading history...
22