| Total Complexity | 1 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # https://github.com/meadsteve/lagom/issues/159 |
||
| 2 | import abc |
||
| 3 | |||
| 4 | from lagom import Container |
||
| 5 | |||
| 6 | |||
| 7 | class AbstractFoo(abc.ABC): |
||
| 8 | pass |
||
| 9 | |||
| 10 | |||
| 11 | class Foo(AbstractFoo): |
||
| 12 | pass |
||
| 13 | |||
| 14 | |||
| 15 | def test_it_now_works(): |
||
| 16 | container = Container() |
||
| 17 | container[AbstractFoo] = Foo |
||
|
|
|||
| 18 | |||
| 19 | # This is/was the root cause of the issue |
||
| 20 | container[Foo] = Foo |
||
| 21 | |||
| 22 | assert isinstance(container[AbstractFoo], Foo) |
||
| 23 |