| Total Complexity | 6 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from copy import deepcopy |
||
| 2 | |||
| 3 | import pytest |
||
| 4 | |||
| 5 | from lagom import injectable |
||
| 6 | from lagom.exceptions import InjectableNotResolved |
||
| 7 | |||
| 8 | |||
| 9 | def test_injectable_is_falsy(): |
||
| 10 | assert not injectable |
||
| 11 | |||
| 12 | |||
| 13 | def test_trying_to_reference_a_property_on_injectable_raises_an_error(): |
||
| 14 | with pytest.raises(InjectableNotResolved): |
||
| 15 | injectable.some_value # type: ignore |
||
| 16 | |||
| 17 | |||
| 18 | def test_trying_to_call_things_on_injectable_raises_an_error(): |
||
| 19 | with pytest.raises(InjectableNotResolved): |
||
| 20 | injectable.do_thing() # type: ignore |
||
| 21 | |||
| 22 | |||
| 23 | def test_cloning_injectable_is_the_same_injectable(): |
||
| 24 | assert injectable is deepcopy(injectable) |
||
| 25 |