diff options
Diffstat (limited to 'app/tests/test_backends_audiocpp.py')
| -rw-r--r-- | app/tests/test_backends_audiocpp.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/tests/test_backends_audiocpp.py b/app/tests/test_backends_audiocpp.py index e206ddd..665dbf0 100644 --- a/app/tests/test_backends_audiocpp.py +++ b/app/tests/test_backends_audiocpp.py @@ -1836,6 +1836,35 @@ class UninstallTests(unittest.TestCase): self.assertEqual(rc, 0) mk_stop.assert_called_once_with("audiocpp") + def test_accepts_task_view_kwargs_for_registry_symmetry(self): + # The hub calls uninstall(emit=..., cancel=...); emit is unused here + # (no subprocess phase) and cancel=None behaves like the plain call. + with tempfile.TemporaryDirectory() as td: + checkout = Path(td) / "audio.cpp" + checkout.mkdir() + with patch.object(make_server, "find_local_checkout", + return_value=checkout), \ + patch.object(make_server.servers, "stop"): + rc = make_server.uninstall(emit=lambda line: None, + cancel=None) + self.assertEqual(rc, 0) + self.assertFalse(checkout.exists()) + + def test_cancel_before_delete_keeps_checkout(self): + # Cancel is honored between phases only: once the server is stopped + # and cancellation is pending, the checkout deletion never starts. + with tempfile.TemporaryDirectory() as td: + checkout = Path(td) / "audio.cpp" + checkout.mkdir() + cancel = threading.Event() + cancel.set() + with patch.object(make_server, "find_local_checkout", + return_value=checkout), \ + patch.object(make_server.servers, "stop"): + rc = make_server.uninstall(cancel=cancel) + self.assertEqual(rc, 130) + self.assertTrue(checkout.exists()) + if __name__ == "__main__": unittest.main() |
