| Conditions | 1 |
| Total Lines | 12 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import pytest |
||
| 20 | def test_simple_memoize(simple_memoize): |
||
| 21 | runtime_args = (7, 'gg') |
||
| 22 | runtime_kwargs = dict(kwarg1='something', kwarg2=[1, 2]) |
||
| 23 | instance1 = simple_memoize.get_object(*runtime_args, **runtime_kwargs) |
||
| 24 | instance2 = simple_memoize.get_object(*runtime_args, **runtime_kwargs) |
||
| 25 | assert instance1 == instance2 |
||
| 26 | assert id(instance1) == id(instance2) |
||
| 27 | hash1 = simple_memoize._build_hash(*runtime_args, **runtime_kwargs) |
||
| 28 | assert hash1 == hash( |
||
| 29 | '-'.join( |
||
| 30 | [str(_) for _ in runtime_args] |
||
| 31 | + [f'{key}={str(value)}' for key, value in runtime_kwargs.items()] |
||
| 32 | ) |
||
| 34 |