(path, *args, **kwargs)
| 23 | def get_custom_mock_open(global_conf_str, local_conf_str) -> callable: |
| 24 | def mocked_open(): |
| 25 | def conditional_open_func(path, *args, **kwargs): |
| 26 | p = Path(path).expanduser().resolve() |
| 27 | if p.name == ".codecarbon.config": |
| 28 | if p.parent == Path.home(): |
| 29 | return mock_open(read_data=global_conf_str)() |
| 30 | return mock_open(read_data=local_conf_str)() |
| 31 | return OPEN(path, *args, **kwargs) |
| 32 | |
| 33 | return conditional_open_func |
| 34 |
nothing calls this directly
no test coverage detected
searching dependent graphs…