| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """ |
||
| 2 | https://github.com/meadsteve/lagom/issues/150 |
||
| 3 | """ |
||
| 4 | |||
| 5 | from lagom import Container |
||
| 6 | |||
| 7 | |||
| 8 | class Something: |
||
| 9 | def __init__(self, value="the default"): |
||
| 10 | self.value = value |
||
| 11 | |||
| 12 | |||
| 13 | class SomethingInterface: |
||
| 14 | value: str |
||
| 15 | |||
| 16 | |||
| 17 | def test_an_alias_doesnt_skip_a_defined_constructor(): |
||
| 18 | container = Container() |
||
| 19 | container[Something] = lambda: Something("the correct value") |
||
|
|
|||
| 20 | container[SomethingInterface] = Something # type: ignore |
||
| 21 | |||
| 22 | assert container[SomethingInterface].value == "the correct value" |
||
| 23 |