Point tunnel_registry_dir at tmp for the duration of a test.
(testcase, tmp: Path)
| 25 | |
| 26 | |
| 27 | def _patch_registry_dir(testcase, tmp: Path): |
| 28 | """Point tunnel_registry_dir at tmp for the duration of a test.""" |
| 29 | patcher = mock.patch.object( |
| 30 | tunnel_registry_mod, |
| 31 | 'tunnel_registry_dir', |
| 32 | return_value=tmp, |
| 33 | ) |
| 34 | patcher.start() |
| 35 | testcase.addCleanup(patcher.stop) |
| 36 | tunnel_registry_mod._registry_dir_initialized = False |
| 37 | |
| 38 | |
| 39 | class TestNormalizeBindHost(unittest.TestCase): |