def _test_get_root_helper_child_pid(self, expected=_marker, run_as_root=False, pids=None):

    def _find_child_pids(x):
        if (not pids):
            return []
        pids.pop(0)
        return pids
    mock_pid = object()
    with mock.patch.object(utils, 'find_child_pids', side_effect=_find_child_pids):
        actual = utils.get_root_helper_child_pid(mock_pid, run_as_root)
    if (expected is _marker):
        expected = str(mock_pid)
    self.assertEqual(expected, actual)
def _test_get_root_helper_child_pid(self, expected=_marker, run_as_root=False, pids=None):

    def _find_child_pids(x):
        if (not pids):
            return []
        pids.pop(0)
        return pids
    mock_pid = object()
    with mock.patch.object(utils, 'find_child_pids', side_effect=_find_child_pids):
        actual = utils.get_root_helper_child_pid(mock_pid, run_as_root)
    if (expected is _marker):
        expected = str(mock_pid)
    self.assertEqual(expected, actual)