def test_find_cgroup_path_for_pod_systemd_with_container_id(
        qos, expected_cgroup_path):
    assert expected_cgroup_path == _build_cgroup_path(
        cgroup_driver='systemd',
        qos=qos,
        pod_id=_POD_ID,
        container_id=_CONTAINER_ID)
def test_find_cgroup_path_pod_cgroupfs(qos, expected_cgroup_path):
    assert expected_cgroup_path == _build_cgroup_path(cgroup_driver='cgroupfs',
                                                      qos=qos, pod_id=_POD_ID)
def test_find_cgroup_path_for_pod_systemd(qos, expected_cgroup_path):
    assert expected_cgroup_path == _build_cgroup_path(cgroup_driver='systemd',
                                                      qos=qos, pod_id=_POD_ID)
def test_raise_missing_cgroup_exception_build_cgroup_path_pod_cgroupfs(
        mock_path_exists):
    with pytest.raises(MissingCgroupException):
        _build_cgroup_path(cgroup_driver='cgroupfs',
                           qos='burstable',
                           pod_id=_STATIC_POD_ID)
def test_build_cgroup_path_static_pod_cgroupfs(mock_path_exists, qos,
                                               expected_cgroup_path):
    assert expected_cgroup_path == _build_cgroup_path(cgroup_driver='cgroupfs',
                                                      qos=qos,
                                                      pod_id=_STATIC_POD_ID)