def test_delete_kernel(self): language = 'python' controller = KernelController(PATH) kernel = controller._get_kernel(language) pid = kernel.pid self.assertEqual(check_pid(pid), True) controller.delete_kernel(language) kernel.wait() self.assertEqual(check_pid(pid), False) self.assertEqual(language in controller, False)
def test_delete_controller(self): """ Check that deleting a controller will kill child subprocesses. """ controller = KernelController(PATH) kernels = [controller._get_kernel(lang) \ for lang in controller.languages()] pids = [kernel.pid for kernel in kernels] del controller for pid, kernel in zip(pids, kernels): kernel.wait() self.assertEquals(check_pid(pid), False)